From b79bce3b89b78926b0038e8191f93c9fade6ae26 Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Thu, 5 Mar 2026 15:20:11 +0000 Subject: [PATCH 1/2] Generate postgresflex --- services/postgresflex/api_default.go | 306 +- services/postgresflex/client.go | 7 + services/postgresflex/configuration.go | 2 + services/postgresflex/go.mod | 2 +- services/postgresflex/go.sum | 4 +- services/postgresflex/model_acl.go | 24 + .../postgresflex/model_api_configuration.go | 33 + ...odel_api_extension_config_load_response.go | 24 + .../model_api_extension_configure_response.go | 24 + .../model_api_extension_delete_response.go | 24 + .../postgresflex/model_api_extension_list.go | 44 + .../model_api_extension_load_response.go | 24 + .../model_api_install_response.go | 24 + .../model_api_installed_list_response.go | 24 + services/postgresflex/model_backup.go | 96 + .../model_clone_instance_payload.go | 44 + .../model_clone_instance_response.go | 23 + .../model_create_database_payload.go | 34 + .../model_create_instance_payload.go | 101 + .../model_create_instance_response.go | 23 + .../postgresflex/model_create_user_payload.go | 34 + .../model_create_user_response.go | 24 + services/postgresflex/model_error.go | 55 + .../model_extensions_configuration.go | 33 + ...odel_extensions_extension_list_response.go | 24 + .../model_extensions_new_config.go | 24 + services/postgresflex/model_flavor.go | 55 + .../postgresflex/model_get_backup_response.go | 24 + .../postgresflex/model_get_user_response.go | 24 + services/postgresflex/model_instance.go | 118 + ...model_instance_create_database_response.go | 23 + .../postgresflex/model_instance_data_point.go | 34 + .../postgresflex/model_instance_database.go | 44 + services/postgresflex/model_instance_host.go | 34 + .../model_instance_host_metric.go | 44 + .../model_instance_list_databases_response.go | 24 + .../model_instance_list_instance.go | 43 + .../model_instance_metrics_response.go | 24 + .../postgresflex/model_instance_response.go | 24 + .../model_list_backups_response.go | 35 + .../model_list_flavors_response.go | 24 + .../model_list_instances_response.go | 35 + .../model_list_storages_response.go | 35 + .../postgresflex/model_list_users_response.go | 35 + .../model_list_users_response_item.go | 33 + .../model_list_versions_response.go | 24 + .../model_partial_update_instance_payload.go | 108 + .../model_partial_update_instance_response.go | 24 + .../model_partial_update_user_payload.go | 34 + .../model_postgres_database_parameter.go | 135 + ...el_postgres_database_parameter_response.go | 24 + .../postgresflex/model_reset_user_response.go | 24 + services/postgresflex/model_storage.go | 34 + services/postgresflex/model_storage_range.go | 35 + services/postgresflex/model_storage_update.go | 37 +- .../model_update_backup_schedule_payload.go | 23 + .../model_update_instance_payload.go | 108 + .../postgresflex/model_update_user_payload.go | 34 + services/postgresflex/model_user.go | 95 + services/postgresflex/model_user_response.go | 65 + services/postgresflex/oas_commit | 2 +- services/postgresflex/utils.go | 81 + services/postgresflex/v1api/api_default.go | 4030 +++++++++++ .../postgresflex/v1api/api_default_mock.go | 567 ++ services/postgresflex/v1api/client.go | 659 ++ services/postgresflex/v1api/configuration.go | 41 + services/postgresflex/v1api/model_acl.go | 125 + .../v1api/model_api_configuration.go | 161 + ...odel_api_extension_config_load_response.go | 126 + .../model_api_extension_configure_response.go | 126 + .../model_api_extension_delete_response.go | 125 + .../v1api/model_api_extension_list.go | 197 + .../model_api_extension_load_response.go | 125 + .../v1api/model_api_install_response.go | 125 + .../model_api_installed_list_response.go | 125 + services/postgresflex/v1api/model_backup.go | 377 ++ .../v1api/model_clone_instance_payload.go | 198 + .../v1api/model_clone_instance_response.go | 125 + .../v1api/model_create_database_payload.go | 162 + .../v1api/model_create_instance_payload.go | 390 ++ .../v1api/model_create_instance_response.go | 125 + .../v1api/model_create_user_payload.go | 161 + .../v1api/model_create_user_response.go | 125 + services/postgresflex/v1api/model_error.go | 233 + .../v1api/model_extensions_configuration.go | 161 + ...odel_extensions_extension_list_response.go | 125 + .../v1api/model_extensions_new_config.go | 125 + services/postgresflex/v1api/model_flavor.go | 233 + .../v1api/model_get_backup_response.go | 125 + .../v1api/model_get_user_response.go | 125 + services/postgresflex/v1api/model_instance.go | 449 ++ ...model_instance_create_database_response.go | 125 + .../v1api/model_instance_data_point.go | 161 + .../v1api/model_instance_database.go | 198 + .../postgresflex/v1api/model_instance_host.go | 161 + .../v1api/model_instance_host_metric.go | 197 + .../model_instance_list_databases_response.go | 125 + .../v1api/model_instance_list_instance.go | 197 + .../v1api/model_instance_metrics_response.go | 125 + .../v1api/model_instance_response.go | 125 + .../v1api/model_list_backups_response.go | 161 + .../v1api/model_list_flavors_response.go | 125 + .../v1api/model_list_instances_response.go | 161 + .../v1api/model_list_storages_response.go | 161 + .../v1api/model_list_users_response.go | 161 + .../v1api/model_list_users_response_item.go | 161 + .../v1api/model_list_versions_response.go | 125 + .../model_partial_update_instance_payload.go | 414 ++ .../model_partial_update_instance_response.go | 125 + .../model_partial_update_user_payload.go | 161 + .../model_postgres_database_parameter.go | 533 ++ ...el_postgres_database_parameter_response.go | 126 + .../v1api/model_reset_user_response.go | 125 + services/postgresflex/v1api/model_storage.go | 161 + .../postgresflex/v1api/model_storage_range.go | 161 + .../v1api/model_storage_update.go | 166 + .../model_update_backup_schedule_payload.go | 157 + .../v1api/model_update_instance_payload.go | 414 ++ .../v1api/model_update_user_payload.go | 161 + services/postgresflex/v1api/model_user.go | 377 ++ .../postgresflex/v1api/model_user_response.go | 269 + services/postgresflex/v1api/response.go | 48 + services/postgresflex/v1api/utils.go | 362 + services/postgresflex/v2api/api_default.go | 4484 ++++++++++++ .../postgresflex/v2api/api_default_mock.go | 593 ++ services/postgresflex/v2api/client.go | 659 ++ services/postgresflex/v2api/configuration.go | 38 + services/postgresflex/v2api/model_acl.go | 125 + .../v2api/model_api_configuration.go | 161 + ...odel_api_extension_config_load_response.go | 126 + .../model_api_extension_configure_response.go | 126 + .../model_api_extension_delete_response.go | 125 + .../v2api/model_api_extension_list.go | 197 + .../model_api_extension_load_response.go | 125 + .../v2api/model_api_install_response.go | 125 + .../model_api_installed_list_response.go | 125 + services/postgresflex/v2api/model_backup.go | 377 ++ .../v2api/model_clone_instance_payload.go | 198 + .../v2api/model_clone_instance_response.go | 125 + .../v2api/model_create_database_payload.go | 162 + .../v2api/model_create_instance_payload.go | 390 ++ .../v2api/model_create_instance_response.go | 125 + .../v2api/model_create_user_payload.go | 161 + .../v2api/model_create_user_response.go | 125 + services/postgresflex/v2api/model_error.go | 233 + .../v2api/model_extensions_configuration.go | 161 + ...odel_extensions_extension_list_response.go | 125 + .../v2api/model_extensions_new_config.go | 125 + services/postgresflex/v2api/model_flavor.go | 233 + .../v2api/model_get_backup_response.go | 125 + .../v2api/model_get_user_response.go | 125 + services/postgresflex/v2api/model_instance.go | 449 ++ ...model_instance_create_database_response.go | 125 + .../v2api/model_instance_data_point.go | 161 + .../v2api/model_instance_database.go | 198 + .../postgresflex/v2api/model_instance_host.go | 161 + .../v2api/model_instance_host_metric.go | 197 + .../model_instance_list_databases_response.go | 125 + .../v2api/model_instance_list_instance.go | 197 + .../v2api/model_instance_metrics_response.go | 125 + .../v2api/model_instance_response.go | 125 + .../v2api/model_list_backups_response.go | 161 + .../v2api/model_list_flavors_response.go | 125 + .../v2api/model_list_instances_response.go | 161 + .../v2api/model_list_storages_response.go | 161 + .../v2api/model_list_users_response.go | 161 + .../v2api/model_list_users_response_item.go | 161 + .../v2api/model_list_versions_response.go | 125 + .../model_partial_update_instance_payload.go | 414 ++ .../model_partial_update_instance_response.go | 125 + .../model_partial_update_user_payload.go | 161 + .../model_postgres_database_parameter.go | 533 ++ ...el_postgres_database_parameter_response.go | 126 + .../v2api/model_reset_user_response.go | 125 + services/postgresflex/v2api/model_storage.go | 161 + .../postgresflex/v2api/model_storage_range.go | 161 + .../v2api/model_storage_update.go | 166 + .../model_update_backup_schedule_payload.go | 157 + .../v2api/model_update_instance_payload.go | 414 ++ .../v2api/model_update_user_payload.go | 161 + services/postgresflex/v2api/model_user.go | 377 ++ .../postgresflex/v2api/model_user_response.go | 269 + services/postgresflex/v2api/response.go | 48 + services/postgresflex/v2api/utils.go | 362 + .../postgresflex/v3alpha1api/api_default.go | 6006 +++++++++++++++++ .../v3alpha1api/api_default_mock.go | 615 ++ services/postgresflex/v3alpha1api/client.go | 659 ++ .../postgresflex/v3alpha1api/configuration.go | 41 + .../v3alpha1api/model_backup_sort.go | 131 + .../model_clone_instance_overrides.go | 187 + .../model_clone_request_payload.go | 187 + .../v3alpha1api/model_clone_response.go | 158 + .../model_create_database_request_payload.go | 195 + .../model_create_database_response.go | 158 + .../model_create_instance_request_payload.go | 394 ++ .../model_create_instance_response.go | 158 + .../model_create_user_request_payload.go | 195 + .../v3alpha1api/model_create_user_response.go | 245 + .../v3alpha1api/model_database_roles.go | 187 + .../v3alpha1api/model_database_sort.go | 123 + .../postgresflex/v3alpha1api/model_error.go | 245 + .../v3alpha1api/model_flavor_sort.go | 139 + ...el_flavor_storage_classes_storage_class.go | 213 + .../v3alpha1api/model_get_backup_response.go | 303 + .../model_get_collations_response.go | 158 + .../model_get_database_response.go | 216 + .../v3alpha1api/model_get_flavors_response.go | 186 + .../model_get_instance_response.go | 545 ++ .../v3alpha1api/model_get_user_response.go | 245 + .../model_get_versions_response.go | 158 + .../model_instance_connection_info.go | 157 + .../model_instance_connection_info_write.go | 187 + .../v3alpha1api/model_instance_encryption.go | 244 + .../v3alpha1api/model_instance_network.go | 270 + .../model_instance_network_access_scope.go | 111 + .../model_instance_network_create.go | 198 + .../v3alpha1api/model_instance_network_opt.go | 126 + .../model_instance_network_update.go | 158 + .../v3alpha1api/model_instance_sort.go | 123 + .../model_instance_storage_range.go | 187 + .../v3alpha1api/model_list_backup.go | 303 + .../v3alpha1api/model_list_backup_response.go | 186 + .../v3alpha1api/model_list_database.go | 216 + .../model_list_databases_response.go | 186 + .../v3alpha1api/model_list_flavors.go | 361 + .../v3alpha1api/model_list_instance.go | 244 + .../model_list_instances_response.go | 186 + .../v3alpha1api/model_list_roles_response.go | 158 + .../v3alpha1api/model_list_user.go | 216 + .../v3alpha1api/model_list_user_response.go | 186 + .../v3alpha1api/model_pagination.go | 269 + .../model_protect_instance_request_payload.go | 158 + .../model_protect_instance_response.go | 158 + .../v3alpha1api/model_replicas.go | 111 + .../v3alpha1api/model_replicas_opt.go | 111 + .../v3alpha1api/model_reset_user_response.go | 216 + .../postgresflex/v3alpha1api/model_status.go | 119 + .../postgresflex/v3alpha1api/model_storage.go | 163 + .../v3alpha1api/model_storage_create.go | 187 + .../v3alpha1api/model_storage_update.go | 126 + ...date_database_partially_request_payload.go | 163 + ...odel_update_database_partially_response.go | 157 + .../model_update_database_request_payload.go | 187 + .../model_update_database_response.go | 157 + ...date_instance_partially_request_payload.go | 382 ++ .../model_update_instance_request_payload.go | 358 + ...l_update_user_partially_request_payload.go | 163 + .../model_update_user_request_payload.go | 195 + .../v3alpha1api/model_user_role.go | 111 + .../v3alpha1api/model_user_sort.go | 119 + .../v3alpha1api/model_validation_error.go | 187 + ...model_validation_error_validation_inner.go | 185 + .../postgresflex/v3alpha1api/model_version.go | 245 + services/postgresflex/v3alpha1api/response.go | 48 + services/postgresflex/v3alpha1api/utils.go | 362 + services/postgresflex/wait/deprecation.go | 2 + 256 files changed, 55798 insertions(+), 48 deletions(-) create mode 100644 services/postgresflex/v1api/api_default.go create mode 100644 services/postgresflex/v1api/api_default_mock.go create mode 100644 services/postgresflex/v1api/client.go create mode 100644 services/postgresflex/v1api/configuration.go create mode 100644 services/postgresflex/v1api/model_acl.go create mode 100644 services/postgresflex/v1api/model_api_configuration.go create mode 100644 services/postgresflex/v1api/model_api_extension_config_load_response.go create mode 100644 services/postgresflex/v1api/model_api_extension_configure_response.go create mode 100644 services/postgresflex/v1api/model_api_extension_delete_response.go create mode 100644 services/postgresflex/v1api/model_api_extension_list.go create mode 100644 services/postgresflex/v1api/model_api_extension_load_response.go create mode 100644 services/postgresflex/v1api/model_api_install_response.go create mode 100644 services/postgresflex/v1api/model_api_installed_list_response.go create mode 100644 services/postgresflex/v1api/model_backup.go create mode 100644 services/postgresflex/v1api/model_clone_instance_payload.go create mode 100644 services/postgresflex/v1api/model_clone_instance_response.go create mode 100644 services/postgresflex/v1api/model_create_database_payload.go create mode 100644 services/postgresflex/v1api/model_create_instance_payload.go create mode 100644 services/postgresflex/v1api/model_create_instance_response.go create mode 100644 services/postgresflex/v1api/model_create_user_payload.go create mode 100644 services/postgresflex/v1api/model_create_user_response.go create mode 100644 services/postgresflex/v1api/model_error.go create mode 100644 services/postgresflex/v1api/model_extensions_configuration.go create mode 100644 services/postgresflex/v1api/model_extensions_extension_list_response.go create mode 100644 services/postgresflex/v1api/model_extensions_new_config.go create mode 100644 services/postgresflex/v1api/model_flavor.go create mode 100644 services/postgresflex/v1api/model_get_backup_response.go create mode 100644 services/postgresflex/v1api/model_get_user_response.go create mode 100644 services/postgresflex/v1api/model_instance.go create mode 100644 services/postgresflex/v1api/model_instance_create_database_response.go create mode 100644 services/postgresflex/v1api/model_instance_data_point.go create mode 100644 services/postgresflex/v1api/model_instance_database.go create mode 100644 services/postgresflex/v1api/model_instance_host.go create mode 100644 services/postgresflex/v1api/model_instance_host_metric.go create mode 100644 services/postgresflex/v1api/model_instance_list_databases_response.go create mode 100644 services/postgresflex/v1api/model_instance_list_instance.go create mode 100644 services/postgresflex/v1api/model_instance_metrics_response.go create mode 100644 services/postgresflex/v1api/model_instance_response.go create mode 100644 services/postgresflex/v1api/model_list_backups_response.go create mode 100644 services/postgresflex/v1api/model_list_flavors_response.go create mode 100644 services/postgresflex/v1api/model_list_instances_response.go create mode 100644 services/postgresflex/v1api/model_list_storages_response.go create mode 100644 services/postgresflex/v1api/model_list_users_response.go create mode 100644 services/postgresflex/v1api/model_list_users_response_item.go create mode 100644 services/postgresflex/v1api/model_list_versions_response.go create mode 100644 services/postgresflex/v1api/model_partial_update_instance_payload.go create mode 100644 services/postgresflex/v1api/model_partial_update_instance_response.go create mode 100644 services/postgresflex/v1api/model_partial_update_user_payload.go create mode 100644 services/postgresflex/v1api/model_postgres_database_parameter.go create mode 100644 services/postgresflex/v1api/model_postgres_database_parameter_response.go create mode 100644 services/postgresflex/v1api/model_reset_user_response.go create mode 100644 services/postgresflex/v1api/model_storage.go create mode 100644 services/postgresflex/v1api/model_storage_range.go create mode 100644 services/postgresflex/v1api/model_storage_update.go create mode 100644 services/postgresflex/v1api/model_update_backup_schedule_payload.go create mode 100644 services/postgresflex/v1api/model_update_instance_payload.go create mode 100644 services/postgresflex/v1api/model_update_user_payload.go create mode 100644 services/postgresflex/v1api/model_user.go create mode 100644 services/postgresflex/v1api/model_user_response.go create mode 100644 services/postgresflex/v1api/response.go create mode 100644 services/postgresflex/v1api/utils.go create mode 100644 services/postgresflex/v2api/api_default.go create mode 100644 services/postgresflex/v2api/api_default_mock.go create mode 100644 services/postgresflex/v2api/client.go create mode 100644 services/postgresflex/v2api/configuration.go create mode 100644 services/postgresflex/v2api/model_acl.go create mode 100644 services/postgresflex/v2api/model_api_configuration.go create mode 100644 services/postgresflex/v2api/model_api_extension_config_load_response.go create mode 100644 services/postgresflex/v2api/model_api_extension_configure_response.go create mode 100644 services/postgresflex/v2api/model_api_extension_delete_response.go create mode 100644 services/postgresflex/v2api/model_api_extension_list.go create mode 100644 services/postgresflex/v2api/model_api_extension_load_response.go create mode 100644 services/postgresflex/v2api/model_api_install_response.go create mode 100644 services/postgresflex/v2api/model_api_installed_list_response.go create mode 100644 services/postgresflex/v2api/model_backup.go create mode 100644 services/postgresflex/v2api/model_clone_instance_payload.go create mode 100644 services/postgresflex/v2api/model_clone_instance_response.go create mode 100644 services/postgresflex/v2api/model_create_database_payload.go create mode 100644 services/postgresflex/v2api/model_create_instance_payload.go create mode 100644 services/postgresflex/v2api/model_create_instance_response.go create mode 100644 services/postgresflex/v2api/model_create_user_payload.go create mode 100644 services/postgresflex/v2api/model_create_user_response.go create mode 100644 services/postgresflex/v2api/model_error.go create mode 100644 services/postgresflex/v2api/model_extensions_configuration.go create mode 100644 services/postgresflex/v2api/model_extensions_extension_list_response.go create mode 100644 services/postgresflex/v2api/model_extensions_new_config.go create mode 100644 services/postgresflex/v2api/model_flavor.go create mode 100644 services/postgresflex/v2api/model_get_backup_response.go create mode 100644 services/postgresflex/v2api/model_get_user_response.go create mode 100644 services/postgresflex/v2api/model_instance.go create mode 100644 services/postgresflex/v2api/model_instance_create_database_response.go create mode 100644 services/postgresflex/v2api/model_instance_data_point.go create mode 100644 services/postgresflex/v2api/model_instance_database.go create mode 100644 services/postgresflex/v2api/model_instance_host.go create mode 100644 services/postgresflex/v2api/model_instance_host_metric.go create mode 100644 services/postgresflex/v2api/model_instance_list_databases_response.go create mode 100644 services/postgresflex/v2api/model_instance_list_instance.go create mode 100644 services/postgresflex/v2api/model_instance_metrics_response.go create mode 100644 services/postgresflex/v2api/model_instance_response.go create mode 100644 services/postgresflex/v2api/model_list_backups_response.go create mode 100644 services/postgresflex/v2api/model_list_flavors_response.go create mode 100644 services/postgresflex/v2api/model_list_instances_response.go create mode 100644 services/postgresflex/v2api/model_list_storages_response.go create mode 100644 services/postgresflex/v2api/model_list_users_response.go create mode 100644 services/postgresflex/v2api/model_list_users_response_item.go create mode 100644 services/postgresflex/v2api/model_list_versions_response.go create mode 100644 services/postgresflex/v2api/model_partial_update_instance_payload.go create mode 100644 services/postgresflex/v2api/model_partial_update_instance_response.go create mode 100644 services/postgresflex/v2api/model_partial_update_user_payload.go create mode 100644 services/postgresflex/v2api/model_postgres_database_parameter.go create mode 100644 services/postgresflex/v2api/model_postgres_database_parameter_response.go create mode 100644 services/postgresflex/v2api/model_reset_user_response.go create mode 100644 services/postgresflex/v2api/model_storage.go create mode 100644 services/postgresflex/v2api/model_storage_range.go create mode 100644 services/postgresflex/v2api/model_storage_update.go create mode 100644 services/postgresflex/v2api/model_update_backup_schedule_payload.go create mode 100644 services/postgresflex/v2api/model_update_instance_payload.go create mode 100644 services/postgresflex/v2api/model_update_user_payload.go create mode 100644 services/postgresflex/v2api/model_user.go create mode 100644 services/postgresflex/v2api/model_user_response.go create mode 100644 services/postgresflex/v2api/response.go create mode 100644 services/postgresflex/v2api/utils.go create mode 100644 services/postgresflex/v3alpha1api/api_default.go create mode 100644 services/postgresflex/v3alpha1api/api_default_mock.go create mode 100644 services/postgresflex/v3alpha1api/client.go create mode 100644 services/postgresflex/v3alpha1api/configuration.go create mode 100644 services/postgresflex/v3alpha1api/model_backup_sort.go create mode 100644 services/postgresflex/v3alpha1api/model_clone_instance_overrides.go create mode 100644 services/postgresflex/v3alpha1api/model_clone_request_payload.go create mode 100644 services/postgresflex/v3alpha1api/model_clone_response.go create mode 100644 services/postgresflex/v3alpha1api/model_create_database_request_payload.go create mode 100644 services/postgresflex/v3alpha1api/model_create_database_response.go create mode 100644 services/postgresflex/v3alpha1api/model_create_instance_request_payload.go create mode 100644 services/postgresflex/v3alpha1api/model_create_instance_response.go create mode 100644 services/postgresflex/v3alpha1api/model_create_user_request_payload.go create mode 100644 services/postgresflex/v3alpha1api/model_create_user_response.go create mode 100644 services/postgresflex/v3alpha1api/model_database_roles.go create mode 100644 services/postgresflex/v3alpha1api/model_database_sort.go create mode 100644 services/postgresflex/v3alpha1api/model_error.go create mode 100644 services/postgresflex/v3alpha1api/model_flavor_sort.go create mode 100644 services/postgresflex/v3alpha1api/model_flavor_storage_classes_storage_class.go create mode 100644 services/postgresflex/v3alpha1api/model_get_backup_response.go create mode 100644 services/postgresflex/v3alpha1api/model_get_collations_response.go create mode 100644 services/postgresflex/v3alpha1api/model_get_database_response.go create mode 100644 services/postgresflex/v3alpha1api/model_get_flavors_response.go create mode 100644 services/postgresflex/v3alpha1api/model_get_instance_response.go create mode 100644 services/postgresflex/v3alpha1api/model_get_user_response.go create mode 100644 services/postgresflex/v3alpha1api/model_get_versions_response.go create mode 100644 services/postgresflex/v3alpha1api/model_instance_connection_info.go create mode 100644 services/postgresflex/v3alpha1api/model_instance_connection_info_write.go create mode 100644 services/postgresflex/v3alpha1api/model_instance_encryption.go create mode 100644 services/postgresflex/v3alpha1api/model_instance_network.go create mode 100644 services/postgresflex/v3alpha1api/model_instance_network_access_scope.go create mode 100644 services/postgresflex/v3alpha1api/model_instance_network_create.go create mode 100644 services/postgresflex/v3alpha1api/model_instance_network_opt.go create mode 100644 services/postgresflex/v3alpha1api/model_instance_network_update.go create mode 100644 services/postgresflex/v3alpha1api/model_instance_sort.go create mode 100644 services/postgresflex/v3alpha1api/model_instance_storage_range.go create mode 100644 services/postgresflex/v3alpha1api/model_list_backup.go create mode 100644 services/postgresflex/v3alpha1api/model_list_backup_response.go create mode 100644 services/postgresflex/v3alpha1api/model_list_database.go create mode 100644 services/postgresflex/v3alpha1api/model_list_databases_response.go create mode 100644 services/postgresflex/v3alpha1api/model_list_flavors.go create mode 100644 services/postgresflex/v3alpha1api/model_list_instance.go create mode 100644 services/postgresflex/v3alpha1api/model_list_instances_response.go create mode 100644 services/postgresflex/v3alpha1api/model_list_roles_response.go create mode 100644 services/postgresflex/v3alpha1api/model_list_user.go create mode 100644 services/postgresflex/v3alpha1api/model_list_user_response.go create mode 100644 services/postgresflex/v3alpha1api/model_pagination.go create mode 100644 services/postgresflex/v3alpha1api/model_protect_instance_request_payload.go create mode 100644 services/postgresflex/v3alpha1api/model_protect_instance_response.go create mode 100644 services/postgresflex/v3alpha1api/model_replicas.go create mode 100644 services/postgresflex/v3alpha1api/model_replicas_opt.go create mode 100644 services/postgresflex/v3alpha1api/model_reset_user_response.go create mode 100644 services/postgresflex/v3alpha1api/model_status.go create mode 100644 services/postgresflex/v3alpha1api/model_storage.go create mode 100644 services/postgresflex/v3alpha1api/model_storage_create.go create mode 100644 services/postgresflex/v3alpha1api/model_storage_update.go create mode 100644 services/postgresflex/v3alpha1api/model_update_database_partially_request_payload.go create mode 100644 services/postgresflex/v3alpha1api/model_update_database_partially_response.go create mode 100644 services/postgresflex/v3alpha1api/model_update_database_request_payload.go create mode 100644 services/postgresflex/v3alpha1api/model_update_database_response.go create mode 100644 services/postgresflex/v3alpha1api/model_update_instance_partially_request_payload.go create mode 100644 services/postgresflex/v3alpha1api/model_update_instance_request_payload.go create mode 100644 services/postgresflex/v3alpha1api/model_update_user_partially_request_payload.go create mode 100644 services/postgresflex/v3alpha1api/model_update_user_request_payload.go create mode 100644 services/postgresflex/v3alpha1api/model_user_role.go create mode 100644 services/postgresflex/v3alpha1api/model_user_sort.go create mode 100644 services/postgresflex/v3alpha1api/model_validation_error.go create mode 100644 services/postgresflex/v3alpha1api/model_validation_error_validation_inner.go create mode 100644 services/postgresflex/v3alpha1api/model_version.go create mode 100644 services/postgresflex/v3alpha1api/response.go create mode 100644 services/postgresflex/v3alpha1api/utils.go create mode 100644 services/postgresflex/wait/deprecation.go diff --git a/services/postgresflex/api_default.go b/services/postgresflex/api_default.go index 84905dec1..7f02889f2 100644 --- a/services/postgresflex/api_default.go +++ b/services/postgresflex/api_default.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex 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 { /* CloneInstance Clone Instance @@ -33,6 +35,8 @@ type DefaultApi interface { @param region The region which should be addressed @param instanceId Instance ID @return ApiCloneInstanceRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CloneInstance(ctx context.Context, projectId string, region string, instanceId string) ApiCloneInstanceRequest /* @@ -44,6 +48,7 @@ type DefaultApi interface { @param instanceId Instance ID @return CloneInstanceResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CloneInstanceExecute(ctx context.Context, projectId string, region string, instanceId string) (*CloneInstanceResponse, error) /* @@ -56,6 +61,8 @@ type DefaultApi interface { @param region The region which should be addressed @param instanceId Instance ID @return ApiCreateDatabaseRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateDatabase(ctx context.Context, projectId string, region string, instanceId string) ApiCreateDatabaseRequest /* @@ -67,6 +74,7 @@ type DefaultApi interface { @param instanceId Instance ID @return InstanceCreateDatabaseResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateDatabaseExecute(ctx context.Context, projectId string, region string, instanceId string) (*InstanceCreateDatabaseResponse, error) /* @@ -77,6 +85,8 @@ type DefaultApi interface { @param projectId Project ID @param region The region which should be addressed @return ApiCreateInstanceRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateInstance(ctx context.Context, projectId string, region string) ApiCreateInstanceRequest /* @@ -87,6 +97,7 @@ type DefaultApi interface { @param region The region which should be addressed @return CreateInstanceResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateInstanceExecute(ctx context.Context, projectId string, region string) (*CreateInstanceResponse, error) /* @@ -98,6 +109,8 @@ type DefaultApi interface { @param region The region which should be addressed @param instanceId Instance ID @return ApiCreateUserRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateUser(ctx context.Context, projectId string, region string, instanceId string) ApiCreateUserRequest /* @@ -109,6 +122,7 @@ type DefaultApi interface { @param instanceId Instance ID @return CreateUserResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateUserExecute(ctx context.Context, projectId string, region string, instanceId string) (*CreateUserResponse, error) /* @@ -121,11 +135,14 @@ type DefaultApi interface { @param instanceId Instance ID @param databaseId Database ID @return ApiDeleteDatabaseRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteDatabase(ctx context.Context, projectId string, region string, instanceId string, databaseId string) ApiDeleteDatabaseRequest /* DeleteDatabaseExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteDatabaseExecute(ctx context.Context, projectId string, region string, instanceId string, databaseId string) error /* @@ -137,11 +154,14 @@ type DefaultApi interface { @param region The region which should be addressed @param instanceId Instance ID @return ApiDeleteInstanceRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteInstance(ctx context.Context, projectId string, region string, instanceId string) ApiDeleteInstanceRequest /* DeleteInstanceExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteInstanceExecute(ctx context.Context, projectId string, region string, instanceId string) error /* @@ -154,11 +174,14 @@ type DefaultApi interface { @param instanceId Instance ID @param userId User ID @return ApiDeleteUserRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiDeleteUserRequest /* DeleteUserExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteUserExecute(ctx context.Context, projectId string, region string, instanceId string, userId string) error /* @@ -170,11 +193,14 @@ type DefaultApi interface { @param region The region which should be addressed @param instanceId Instance ID @return ApiForceDeleteInstanceRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ForceDeleteInstance(ctx context.Context, projectId string, region string, instanceId string) ApiForceDeleteInstanceRequest /* ForceDeleteInstanceExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ForceDeleteInstanceExecute(ctx context.Context, projectId string, region string, instanceId string) error /* @@ -187,6 +213,8 @@ type DefaultApi interface { @param instanceId Instance ID @param backupId Backup ID @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, instanceId string, backupId string) ApiGetBackupRequest /* @@ -199,6 +227,7 @@ type DefaultApi interface { @param backupId Backup ID @return GetBackupResponse + // 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, instanceId string, backupId string) (*GetBackupResponse, error) /* @@ -210,6 +239,8 @@ type DefaultApi interface { @param region The region which should be addressed @param instanceId Instance ID @return ApiGetInstanceRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetInstance(ctx context.Context, projectId string, region string, instanceId string) ApiGetInstanceRequest /* @@ -221,6 +252,7 @@ type DefaultApi interface { @param instanceId Instance ID @return InstanceResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetInstanceExecute(ctx context.Context, projectId string, region string, instanceId string) (*InstanceResponse, error) /* @@ -233,6 +265,8 @@ type DefaultApi interface { @param instanceId Instance ID @param userId User ID @return ApiGetUserRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiGetUserRequest /* @@ -245,6 +279,7 @@ type DefaultApi interface { @param userId User ID @return GetUserResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetUserExecute(ctx context.Context, projectId string, region string, instanceId string, userId string) (*GetUserResponse, error) /* @@ -256,6 +291,8 @@ type DefaultApi interface { @param region The region which should be addressed @param instanceId Instance ID @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, instanceId string) ApiListBackupsRequest /* @@ -267,6 +304,7 @@ type DefaultApi interface { @param instanceId Instance ID @return ListBackupsResponse + // 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, instanceId string) (*ListBackupsResponse, error) /* @@ -278,6 +316,8 @@ type DefaultApi interface { @param region The region which should be addressed @param instanceId Instance ID @return ApiListDatabaseParametersRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListDatabaseParameters(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabaseParametersRequest /* @@ -289,6 +329,7 @@ type DefaultApi interface { @param instanceId Instance ID @return PostgresDatabaseParameterResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListDatabaseParametersExecute(ctx context.Context, projectId string, region string, instanceId string) (*PostgresDatabaseParameterResponse, error) /* @@ -300,6 +341,8 @@ type DefaultApi interface { @param region The region which should be addressed @param instanceId Instance ID @return ApiListDatabasesRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListDatabases(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabasesRequest /* @@ -311,6 +354,7 @@ type DefaultApi interface { @param instanceId Instance ID @return InstanceListDatabasesResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListDatabasesExecute(ctx context.Context, projectId string, region string, instanceId string) (*InstanceListDatabasesResponse, error) /* @@ -321,6 +365,8 @@ type DefaultApi interface { @param projectId Project ID @param region The region which should be addressed @return ApiListFlavorsRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListFlavors(ctx context.Context, projectId string, region string) ApiListFlavorsRequest /* @@ -331,6 +377,7 @@ type DefaultApi interface { @param region The region which should be addressed @return ListFlavorsResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListFlavorsExecute(ctx context.Context, projectId string, region string) (*ListFlavorsResponse, error) /* @@ -341,6 +388,8 @@ type DefaultApi interface { @param projectId Project ID @param region The region which should be addressed @return ApiListInstancesRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListInstances(ctx context.Context, projectId string, region string) ApiListInstancesRequest /* @@ -351,6 +400,7 @@ type DefaultApi interface { @param region The region which should be addressed @return ListInstancesResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListInstancesExecute(ctx context.Context, projectId string, region string) (*ListInstancesResponse, error) /* @@ -363,6 +413,8 @@ type DefaultApi interface { @param instanceId The UUID of the instance. @param metric The name of the metric. Valid metrics are 'cpu', 'memory', 'max-connections', 'connections' and 'disk-use'. @return ApiListMetricsRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListMetrics(ctx context.Context, projectId string, region string, instanceId string, metric string) ApiListMetricsRequest /* @@ -375,6 +427,7 @@ type DefaultApi interface { @param metric The name of the metric. Valid metrics are 'cpu', 'memory', 'max-connections', 'connections' and 'disk-use'. @return InstanceMetricsResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListMetricsExecute(ctx context.Context, projectId string, region string, instanceId string, metric string) (*InstanceMetricsResponse, error) /* @@ -386,6 +439,8 @@ type DefaultApi interface { @param region The region which should be addressed @param flavorId Flavor ID @return ApiListStoragesRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListStorages(ctx context.Context, projectId string, region string, flavorId string) ApiListStoragesRequest /* @@ -397,6 +452,7 @@ type DefaultApi interface { @param flavorId Flavor ID @return ListStoragesResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListStoragesExecute(ctx context.Context, projectId string, region string, flavorId string) (*ListStoragesResponse, error) /* @@ -408,6 +464,8 @@ type DefaultApi interface { @param region The region which should be addressed @param instanceId Instance ID @return ApiListUsersRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListUsers(ctx context.Context, projectId string, region string, instanceId string) ApiListUsersRequest /* @@ -419,6 +477,7 @@ type DefaultApi interface { @param instanceId Instance ID @return ListUsersResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListUsersExecute(ctx context.Context, projectId string, region string, instanceId string) (*ListUsersResponse, error) /* @@ -429,6 +488,8 @@ type DefaultApi interface { @param projectId Project ID @param region The region which should be addressed @return ApiListVersionsRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListVersions(ctx context.Context, projectId string, region string) ApiListVersionsRequest /* @@ -439,6 +500,7 @@ type DefaultApi interface { @param region The region which should be addressed @return ListVersionsResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListVersionsExecute(ctx context.Context, projectId string, region string) (*ListVersionsResponse, error) /* @@ -450,6 +512,8 @@ type DefaultApi interface { @param region The region which should be addressed @param instanceId Instance ID @return ApiPartialUpdateInstanceRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ PartialUpdateInstance(ctx context.Context, projectId string, region string, instanceId string) ApiPartialUpdateInstanceRequest /* @@ -461,6 +525,7 @@ type DefaultApi interface { @param instanceId Instance ID @return PartialUpdateInstanceResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ PartialUpdateInstanceExecute(ctx context.Context, projectId string, region string, instanceId string) (*PartialUpdateInstanceResponse, error) /* @@ -473,11 +538,14 @@ type DefaultApi interface { @param instanceId The ID of the instance @param userId The ID of the user in the database @return ApiPartialUpdateUserRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ PartialUpdateUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiPartialUpdateUserRequest /* PartialUpdateUserExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ PartialUpdateUserExecute(ctx context.Context, projectId string, region string, instanceId string, userId string) error /* @@ -490,6 +558,8 @@ type DefaultApi interface { @param instanceId Instance ID @param userId user ID @return ApiResetUserRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ResetUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiResetUserRequest /* @@ -502,6 +572,7 @@ type DefaultApi interface { @param userId user ID @return ResetUserResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ResetUserExecute(ctx context.Context, projectId string, region string, instanceId string, userId string) (*ResetUserResponse, error) /* @@ -513,11 +584,14 @@ type DefaultApi interface { @param region The region which should be addressed @param instanceId Instance ID @return ApiUpdateBackupScheduleRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UpdateBackupSchedule(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateBackupScheduleRequest /* UpdateBackupScheduleExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UpdateBackupScheduleExecute(ctx context.Context, projectId string, region string, instanceId string) error /* @@ -529,6 +603,8 @@ type DefaultApi interface { @param region The region which should be addressed @param instanceId Instance ID @return ApiUpdateInstanceRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UpdateInstance(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceRequest /* @@ -540,6 +616,7 @@ type DefaultApi interface { @param instanceId Instance ID @return PartialUpdateInstanceResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UpdateInstanceExecute(ctx context.Context, projectId string, region string, instanceId string) (*PartialUpdateInstanceResponse, error) /* @@ -552,150 +629,221 @@ type DefaultApi interface { @param instanceId The ID of the instance @param userId The ID of the user in the database @return ApiUpdateUserRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UpdateUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiUpdateUserRequest /* UpdateUserExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UpdateUserExecute(ctx context.Context, projectId string, region string, instanceId string, userId string) error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiCloneInstanceRequest interface { // Body + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead CloneInstancePayload(cloneInstancePayload CloneInstancePayload) ApiCloneInstanceRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*CloneInstanceResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiCreateDatabaseRequest interface { // body + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead CreateDatabasePayload(createDatabasePayload CreateDatabasePayload) ApiCreateDatabaseRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*InstanceCreateDatabaseResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiCreateInstanceRequest interface { // Body + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead CreateInstancePayload(createInstancePayload CreateInstancePayload) ApiCreateInstanceRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*CreateInstanceResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiCreateUserRequest interface { // body + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead CreateUserPayload(createUserPayload CreateUserPayload) ApiCreateUserRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*CreateUserResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiDeleteDatabaseRequest 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 ApiDeleteInstanceRequest 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 ApiDeleteUserRequest 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 ApiForceDeleteInstanceRequest 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 ApiGetBackupRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*GetBackupResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetInstanceRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*InstanceResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetUserRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*GetUserResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListBackupsRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*ListBackupsResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListDatabaseParametersRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*PostgresDatabaseParameterResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListDatabasesRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*InstanceListDatabasesResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListFlavorsRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*ListFlavorsResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListInstancesRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*ListInstancesResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListMetricsRequest interface { // The granularity in ISO8601 e.g. 5 minutes are 'PT5M'. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Granularity(granularity string) ApiListMetricsRequest // The period in ISO8601 format e.g. 5 minutes are 'PT5M'. If no period is provided, the standard value of 5 minutes is used. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Period(period string) ApiListMetricsRequest // The start of the timeframe as timestamp in ISO8601 (RFC3339) e.g. '2023-08-28T07:10:52.536Z'. If no start time is provided, current server time as UTC is used. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Start(start string) ApiListMetricsRequest // The end of the timeframe as timestamp in ISO8601 (RFC3339) e.g. '2023-08-28T07:10:52.536Z'. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead End(end string) ApiListMetricsRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*InstanceMetricsResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListStoragesRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*ListStoragesResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListUsersRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*ListUsersResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListVersionsRequest interface { // Instance ID + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead InstanceId(instanceId string) ApiListVersionsRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*ListVersionsResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiPartialUpdateInstanceRequest interface { // Body + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead PartialUpdateInstancePayload(partialUpdateInstancePayload PartialUpdateInstancePayload) ApiPartialUpdateInstanceRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*PartialUpdateInstanceResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiPartialUpdateUserRequest interface { // The Request body only required in PUT endpoint. If empty request body is send via patch, then login and createdb roles are removed from user. The field + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead PartialUpdateUserPayload(partialUpdateUserPayload PartialUpdateUserPayload) ApiPartialUpdateUserRequest + // 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 ApiResetUserRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*ResetUserResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiUpdateBackupScheduleRequest interface { // Body + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead UpdateBackupSchedulePayload(updateBackupSchedulePayload UpdateBackupSchedulePayload) ApiUpdateBackupScheduleRequest + // 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 ApiUpdateInstanceRequest interface { // Body + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead UpdateInstancePayload(updateInstancePayload UpdateInstancePayload) ApiUpdateInstanceRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*PartialUpdateInstanceResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiUpdateUserRequest interface { // The Request body only required in PUT endpoint. If empty request body is send via patch, then login and createdb roles are removed from user. The field + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead UpdateUserPayload(updateUserPayload UpdateUserPayload) ApiUpdateUserRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() 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 CloneInstanceRequest struct { ctx context.Context apiService *DefaultApiService @@ -706,12 +854,13 @@ type CloneInstanceRequest struct { } // Body - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CloneInstanceRequest) CloneInstancePayload(cloneInstancePayload CloneInstancePayload) ApiCloneInstanceRequest { r.cloneInstancePayload = &cloneInstancePayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CloneInstanceRequest) Execute() (*CloneInstanceResponse, error) { var ( localVarHTTPMethod = http.MethodPost @@ -833,7 +982,7 @@ func (r CloneInstanceRequest) Execute() (*CloneInstanceResponse, error) { /* CloneInstance: Clone Instance -Clone an existing instance of a postgres database to a new destination instance +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 Project ID @@ -851,6 +1000,7 @@ func (a *APIClient) CloneInstance(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) CloneInstanceExecute(ctx context.Context, projectId string, region string, instanceId string) (*CloneInstanceResponse, error) { r := CloneInstanceRequest{ apiService: a.defaultApi, @@ -862,6 +1012,7 @@ func (a *APIClient) CloneInstanceExecute(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 CreateDatabaseRequest struct { ctx context.Context apiService *DefaultApiService @@ -872,12 +1023,13 @@ type CreateDatabaseRequest struct { } // body - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateDatabaseRequest) CreateDatabasePayload(createDatabasePayload CreateDatabasePayload) ApiCreateDatabaseRequest { r.createDatabasePayload = &createDatabasePayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateDatabaseRequest) Execute() (*InstanceCreateDatabaseResponse, error) { var ( localVarHTTPMethod = http.MethodPost @@ -999,8 +1151,7 @@ func (r CreateDatabaseRequest) Execute() (*InstanceCreateDatabaseResponse, error /* CreateDatabase: Create Database -Create database for a user -Note: The name of a valid user must be provided in the "options" map field using the key "owner" +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 Project ID @@ -1018,6 +1169,7 @@ func (a *APIClient) CreateDatabase(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) CreateDatabaseExecute(ctx context.Context, projectId string, region string, instanceId string) (*InstanceCreateDatabaseResponse, error) { r := CreateDatabaseRequest{ apiService: a.defaultApi, @@ -1029,6 +1181,7 @@ func (a *APIClient) CreateDatabaseExecute(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 CreateInstanceRequest struct { ctx context.Context apiService *DefaultApiService @@ -1038,12 +1191,13 @@ type CreateInstanceRequest struct { } // Body - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateInstanceRequest) CreateInstancePayload(createInstancePayload CreateInstancePayload) ApiCreateInstanceRequest { r.createInstancePayload = &createInstancePayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { var ( localVarHTTPMethod = http.MethodPost @@ -1164,7 +1318,7 @@ func (r CreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { /* CreateInstance: Create Instance -Create a new instance of a postgres database +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 Project ID @@ -1180,6 +1334,7 @@ func (a *APIClient) CreateInstance(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) CreateInstanceExecute(ctx context.Context, projectId string, region string) (*CreateInstanceResponse, error) { r := CreateInstanceRequest{ apiService: a.defaultApi, @@ -1190,6 +1345,7 @@ func (a *APIClient) CreateInstanceExecute(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 CreateUserRequest struct { ctx context.Context apiService *DefaultApiService @@ -1200,12 +1356,13 @@ type CreateUserRequest struct { } // body - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateUserRequest) CreateUserPayload(createUserPayload CreateUserPayload) ApiCreateUserRequest { r.createUserPayload = &createUserPayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateUserRequest) Execute() (*CreateUserResponse, error) { var ( localVarHTTPMethod = http.MethodPost @@ -1327,7 +1484,7 @@ func (r CreateUserRequest) Execute() (*CreateUserResponse, error) { /* CreateUser: Create User -Create user for an instance +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 Project ID @@ -1345,6 +1502,7 @@ func (a *APIClient) CreateUser(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) CreateUserExecute(ctx context.Context, projectId string, region string, instanceId string) (*CreateUserResponse, error) { r := CreateUserRequest{ apiService: a.defaultApi, @@ -1356,6 +1514,7 @@ func (a *APIClient) CreateUserExecute(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 DeleteDatabaseRequest struct { ctx context.Context apiService *DefaultApiService @@ -1365,6 +1524,7 @@ type DeleteDatabaseRequest struct { databaseId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r DeleteDatabaseRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete @@ -1471,7 +1631,7 @@ func (r DeleteDatabaseRequest) Execute() error { /* DeleteDatabase: Delete Database -Delete database for an instance +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 Project ID @@ -1491,6 +1651,7 @@ func (a *APIClient) DeleteDatabase(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) DeleteDatabaseExecute(ctx context.Context, projectId string, region string, instanceId string, databaseId string) error { r := DeleteDatabaseRequest{ apiService: a.defaultApi, @@ -1503,6 +1664,7 @@ func (a *APIClient) DeleteDatabaseExecute(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 DeleteInstanceRequest struct { ctx context.Context apiService *DefaultApiService @@ -1511,6 +1673,7 @@ type DeleteInstanceRequest struct { instanceId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r DeleteInstanceRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete @@ -1637,7 +1800,7 @@ func (r DeleteInstanceRequest) Execute() error { /* DeleteInstance: Delete Instance -Delete available instance +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 Project ID @@ -1655,6 +1818,7 @@ func (a *APIClient) DeleteInstance(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) DeleteInstanceExecute(ctx context.Context, projectId string, region string, instanceId string) error { r := DeleteInstanceRequest{ apiService: a.defaultApi, @@ -1666,6 +1830,7 @@ func (a *APIClient) DeleteInstanceExecute(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 DeleteUserRequest struct { ctx context.Context apiService *DefaultApiService @@ -1675,6 +1840,7 @@ type DeleteUserRequest struct { userId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r DeleteUserRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete @@ -1781,7 +1947,7 @@ func (r DeleteUserRequest) Execute() error { /* DeleteUser: Delete User -Delete user for an instance +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 Project ID @@ -1801,6 +1967,7 @@ func (a *APIClient) DeleteUser(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) DeleteUserExecute(ctx context.Context, projectId string, region string, instanceId string, userId string) error { r := DeleteUserRequest{ apiService: a.defaultApi, @@ -1813,6 +1980,7 @@ func (a *APIClient) DeleteUserExecute(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 ForceDeleteInstanceRequest struct { ctx context.Context apiService *DefaultApiService @@ -1821,6 +1989,7 @@ type ForceDeleteInstanceRequest struct { instanceId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ForceDeleteInstanceRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete @@ -1947,7 +2116,7 @@ func (r ForceDeleteInstanceRequest) Execute() error { /* ForceDeleteInstance: Force delete instance -Forces the deletion of an delayed deleted instance +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 Project ID @@ -1965,6 +2134,7 @@ func (a *APIClient) ForceDeleteInstance(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) ForceDeleteInstanceExecute(ctx context.Context, projectId string, region string, instanceId string) error { r := ForceDeleteInstanceRequest{ apiService: a.defaultApi, @@ -1976,6 +2146,7 @@ func (a *APIClient) ForceDeleteInstanceExecute(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 GetBackupRequest struct { ctx context.Context apiService *DefaultApiService @@ -1985,6 +2156,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() (*GetBackupResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -2102,7 +2274,7 @@ func (r GetBackupRequest) Execute() (*GetBackupResponse, error) { /* GetBackup: Get specific backup -Get specific available 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 Project ID @@ -2122,6 +2294,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, instanceId string, backupId string) (*GetBackupResponse, error) { r := GetBackupRequest{ apiService: a.defaultApi, @@ -2134,6 +2307,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 GetInstanceRequest struct { ctx context.Context apiService *DefaultApiService @@ -2142,6 +2316,7 @@ type GetInstanceRequest struct { instanceId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetInstanceRequest) Execute() (*InstanceResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -2258,7 +2433,7 @@ func (r GetInstanceRequest) Execute() (*InstanceResponse, error) { /* GetInstance: Get specific instance -Get specific available instances +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 Project ID @@ -2276,6 +2451,7 @@ func (a *APIClient) GetInstance(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) GetInstanceExecute(ctx context.Context, projectId string, region string, instanceId string) (*InstanceResponse, error) { r := GetInstanceRequest{ apiService: a.defaultApi, @@ -2287,6 +2463,7 @@ func (a *APIClient) GetInstanceExecute(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 GetUserRequest struct { ctx context.Context apiService *DefaultApiService @@ -2296,6 +2473,7 @@ type GetUserRequest struct { userId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetUserRequest) Execute() (*GetUserResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -2413,7 +2591,7 @@ func (r GetUserRequest) Execute() (*GetUserResponse, error) { /* GetUser: Get User -Get specific available user for an instance +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 Project ID @@ -2433,6 +2611,7 @@ func (a *APIClient) GetUser(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) GetUserExecute(ctx context.Context, projectId string, region string, instanceId string, userId string) (*GetUserResponse, error) { r := GetUserRequest{ apiService: a.defaultApi, @@ -2445,6 +2624,7 @@ func (a *APIClient) GetUserExecute(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 ListBackupsRequest struct { ctx context.Context apiService *DefaultApiService @@ -2453,6 +2633,7 @@ type ListBackupsRequest struct { instanceId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListBackupsRequest) Execute() (*ListBackupsResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -2569,7 +2750,7 @@ func (r ListBackupsRequest) Execute() (*ListBackupsResponse, error) { /* ListBackups: List backups -List all backups which are available for a specific instance +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 Project ID @@ -2587,6 +2768,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, instanceId string) (*ListBackupsResponse, error) { r := ListBackupsRequest{ apiService: a.defaultApi, @@ -2598,6 +2780,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 ListDatabaseParametersRequest struct { ctx context.Context apiService *DefaultApiService @@ -2606,6 +2789,7 @@ type ListDatabaseParametersRequest struct { instanceId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListDatabaseParametersRequest) Execute() (*PostgresDatabaseParameterResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -2722,7 +2906,7 @@ func (r ListDatabaseParametersRequest) Execute() (*PostgresDatabaseParameterResp /* ListDatabaseParameters: List Databases parameter -List available databases parameter +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 Project ID @@ -2740,6 +2924,7 @@ func (a *APIClient) ListDatabaseParameters(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) ListDatabaseParametersExecute(ctx context.Context, projectId string, region string, instanceId string) (*PostgresDatabaseParameterResponse, error) { r := ListDatabaseParametersRequest{ apiService: a.defaultApi, @@ -2751,6 +2936,7 @@ func (a *APIClient) ListDatabaseParametersExecute(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 ListDatabasesRequest struct { ctx context.Context apiService *DefaultApiService @@ -2759,6 +2945,7 @@ type ListDatabasesRequest struct { instanceId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListDatabasesRequest) Execute() (*InstanceListDatabasesResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -2875,7 +3062,7 @@ func (r ListDatabasesRequest) Execute() (*InstanceListDatabasesResponse, error) /* ListDatabases: List Databases -List available databases for an instance +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 Project ID @@ -2893,6 +3080,7 @@ func (a *APIClient) ListDatabases(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) ListDatabasesExecute(ctx context.Context, projectId string, region string, instanceId string) (*InstanceListDatabasesResponse, error) { r := ListDatabasesRequest{ apiService: a.defaultApi, @@ -2904,6 +3092,7 @@ func (a *APIClient) ListDatabasesExecute(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 ListFlavorsRequest struct { ctx context.Context apiService *DefaultApiService @@ -2911,6 +3100,7 @@ type ListFlavorsRequest struct { region string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListFlavorsRequest) Execute() (*ListFlavorsResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -3026,7 +3216,7 @@ func (r ListFlavorsRequest) Execute() (*ListFlavorsResponse, error) { /* ListFlavors: Get Flavors -Get available flavors for a specific projectID +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 Project ID @@ -3042,6 +3232,7 @@ func (a *APIClient) ListFlavors(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) ListFlavorsExecute(ctx context.Context, projectId string, region string) (*ListFlavorsResponse, error) { r := ListFlavorsRequest{ apiService: a.defaultApi, @@ -3052,6 +3243,7 @@ func (a *APIClient) ListFlavorsExecute(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 ListInstancesRequest struct { ctx context.Context apiService *DefaultApiService @@ -3059,6 +3251,7 @@ type ListInstancesRequest struct { region string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListInstancesRequest) Execute() (*ListInstancesResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -3174,7 +3367,7 @@ func (r ListInstancesRequest) Execute() (*ListInstancesResponse, error) { /* ListInstances: List Instances -List available instances +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 Project ID @@ -3190,6 +3383,7 @@ func (a *APIClient) ListInstances(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) ListInstancesExecute(ctx context.Context, projectId string, region string) (*ListInstancesResponse, error) { r := ListInstancesRequest{ apiService: a.defaultApi, @@ -3200,6 +3394,7 @@ func (a *APIClient) ListInstancesExecute(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 ListMetricsRequest struct { ctx context.Context apiService *DefaultApiService @@ -3214,33 +3409,34 @@ type ListMetricsRequest struct { } // The granularity in ISO8601 e.g. 5 minutes are 'PT5M'. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListMetricsRequest) Granularity(granularity string) ApiListMetricsRequest { r.granularity = &granularity return r } // The period in ISO8601 format e.g. 5 minutes are 'PT5M'. If no period is provided, the standard value of 5 minutes is used. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListMetricsRequest) Period(period string) ApiListMetricsRequest { r.period = &period return r } // The start of the timeframe as timestamp in ISO8601 (RFC3339) e.g. '2023-08-28T07:10:52.536Z'. If no start time is provided, current server time as UTC is used. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListMetricsRequest) Start(start string) ApiListMetricsRequest { r.start = &start return r } // The end of the timeframe as timestamp in ISO8601 (RFC3339) e.g. '2023-08-28T07:10:52.536Z'. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListMetricsRequest) End(end string) ApiListMetricsRequest { r.end = &end return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListMetricsRequest) Execute() (*InstanceMetricsResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -3392,7 +3588,7 @@ func (r ListMetricsRequest) Execute() (*InstanceMetricsResponse, error) { /* ListMetrics: Get Metric -Returns a metric for an instance. The metric will only be for the master pod if needed. Granularity parameter is always needed. If start and end time is provided, period is not considered in max-connections and disk-use. If you provide start time, you have to provide end time as well and vice versa. +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 UUID of the project. @@ -3412,6 +3608,7 @@ func (a *APIClient) ListMetrics(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) ListMetricsExecute(ctx context.Context, projectId string, region string, instanceId string, metric string) (*InstanceMetricsResponse, error) { r := ListMetricsRequest{ apiService: a.defaultApi, @@ -3424,6 +3621,7 @@ func (a *APIClient) ListMetricsExecute(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 ListStoragesRequest struct { ctx context.Context apiService *DefaultApiService @@ -3432,6 +3630,7 @@ type ListStoragesRequest struct { flavorId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListStoragesRequest) Execute() (*ListStoragesResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -3548,7 +3747,7 @@ func (r ListStoragesRequest) Execute() (*ListStoragesResponse, error) { /* ListStorages: Get Storages -Get available storages for a specific flavor +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 Project ID @@ -3566,6 +3765,7 @@ func (a *APIClient) ListStorages(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) ListStoragesExecute(ctx context.Context, projectId string, region string, flavorId string) (*ListStoragesResponse, error) { r := ListStoragesRequest{ apiService: a.defaultApi, @@ -3577,6 +3777,7 @@ func (a *APIClient) ListStoragesExecute(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 ListUsersRequest struct { ctx context.Context apiService *DefaultApiService @@ -3585,6 +3786,7 @@ type ListUsersRequest struct { instanceId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListUsersRequest) Execute() (*ListUsersResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -3701,7 +3903,7 @@ func (r ListUsersRequest) Execute() (*ListUsersResponse, error) { /* ListUsers: List Users -List available users for an instance +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 Project ID @@ -3719,6 +3921,7 @@ func (a *APIClient) ListUsers(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) ListUsersExecute(ctx context.Context, projectId string, region string, instanceId string) (*ListUsersResponse, error) { r := ListUsersRequest{ apiService: a.defaultApi, @@ -3730,6 +3933,7 @@ func (a *APIClient) ListUsersExecute(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 ListVersionsRequest struct { ctx context.Context apiService *DefaultApiService @@ -3739,12 +3943,13 @@ type ListVersionsRequest struct { } // Instance ID - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListVersionsRequest) InstanceId(instanceId string) ApiListVersionsRequest { r.instanceId = &instanceId return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListVersionsRequest) Execute() (*ListVersionsResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -3863,7 +4068,7 @@ func (r ListVersionsRequest) Execute() (*ListVersionsResponse, error) { /* ListVersions: Get Versions -Get available versions for postgres database +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 Project ID @@ -3879,6 +4084,7 @@ func (a *APIClient) ListVersions(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) ListVersionsExecute(ctx context.Context, projectId string, region string) (*ListVersionsResponse, error) { r := ListVersionsRequest{ apiService: a.defaultApi, @@ -3889,6 +4095,7 @@ func (a *APIClient) ListVersionsExecute(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 PartialUpdateInstanceRequest struct { ctx context.Context apiService *DefaultApiService @@ -3899,12 +4106,13 @@ type PartialUpdateInstanceRequest struct { } // Body - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r PartialUpdateInstanceRequest) PartialUpdateInstancePayload(partialUpdateInstancePayload PartialUpdateInstancePayload) ApiPartialUpdateInstanceRequest { r.partialUpdateInstancePayload = &partialUpdateInstancePayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r PartialUpdateInstanceRequest) Execute() (*PartialUpdateInstanceResponse, error) { var ( localVarHTTPMethod = http.MethodPatch @@ -4026,7 +4234,7 @@ func (r PartialUpdateInstanceRequest) Execute() (*PartialUpdateInstanceResponse, /* PartialUpdateInstance: Update Instance -Update available instance of a postgres database. Supported Versions are 12, 13, 14, 15 -- only upgrades are allowed! +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 Project ID @@ -4044,6 +4252,7 @@ func (a *APIClient) PartialUpdateInstance(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) PartialUpdateInstanceExecute(ctx context.Context, projectId string, region string, instanceId string) (*PartialUpdateInstanceResponse, error) { r := PartialUpdateInstanceRequest{ apiService: a.defaultApi, @@ -4055,6 +4264,7 @@ func (a *APIClient) PartialUpdateInstanceExecute(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 PartialUpdateUserRequest struct { ctx context.Context apiService *DefaultApiService @@ -4066,12 +4276,13 @@ type PartialUpdateUserRequest struct { } // The Request body only required in PUT endpoint. If empty request body is send via patch, then login and createdb roles are removed from user. The field - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r PartialUpdateUserRequest) PartialUpdateUserPayload(partialUpdateUserPayload PartialUpdateUserPayload) ApiPartialUpdateUserRequest { r.partialUpdateUserPayload = &partialUpdateUserPayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r PartialUpdateUserRequest) Execute() error { var ( localVarHTTPMethod = http.MethodPatch @@ -4190,7 +4401,7 @@ func (r PartialUpdateUserRequest) Execute() error { /* PartialUpdateUser: Update User -Update user for an instance. Only the roles are updatable. +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 ID of the project @@ -4210,6 +4421,7 @@ func (a *APIClient) PartialUpdateUser(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) PartialUpdateUserExecute(ctx context.Context, projectId string, region string, instanceId string, userId string) error { r := PartialUpdateUserRequest{ apiService: a.defaultApi, @@ -4222,6 +4434,7 @@ func (a *APIClient) PartialUpdateUserExecute(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 ResetUserRequest struct { ctx context.Context apiService *DefaultApiService @@ -4231,6 +4444,7 @@ type ResetUserRequest struct { userId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ResetUserRequest) Execute() (*ResetUserResponse, error) { var ( localVarHTTPMethod = http.MethodPost @@ -4369,7 +4583,7 @@ func (r ResetUserRequest) Execute() (*ResetUserResponse, error) { /* ResetUser: Reset User -Reset user password for a postgres instance +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 Project ID @@ -4389,6 +4603,7 @@ func (a *APIClient) ResetUser(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) ResetUserExecute(ctx context.Context, projectId string, region string, instanceId string, userId string) (*ResetUserResponse, error) { r := ResetUserRequest{ apiService: a.defaultApi, @@ -4401,6 +4616,7 @@ func (a *APIClient) ResetUserExecute(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 UpdateBackupScheduleRequest struct { ctx context.Context apiService *DefaultApiService @@ -4411,12 +4627,13 @@ type UpdateBackupScheduleRequest struct { } // Body - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdateBackupScheduleRequest) UpdateBackupSchedulePayload(updateBackupSchedulePayload UpdateBackupSchedulePayload) ApiUpdateBackupScheduleRequest { r.updateBackupSchedulePayload = &updateBackupSchedulePayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdateBackupScheduleRequest) Execute() error { var ( localVarHTTPMethod = http.MethodPut @@ -4527,7 +4744,7 @@ func (r UpdateBackupScheduleRequest) Execute() error { /* UpdateBackupSchedule: Update Backup Schedule -Update backup schedule +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 Project ID @@ -4545,6 +4762,7 @@ func (a *APIClient) UpdateBackupSchedule(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) UpdateBackupScheduleExecute(ctx context.Context, projectId string, region string, instanceId string) error { r := UpdateBackupScheduleRequest{ apiService: a.defaultApi, @@ -4556,6 +4774,7 @@ func (a *APIClient) UpdateBackupScheduleExecute(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 UpdateInstanceRequest struct { ctx context.Context apiService *DefaultApiService @@ -4566,12 +4785,13 @@ type UpdateInstanceRequest struct { } // Body - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdateInstanceRequest) UpdateInstancePayload(updateInstancePayload UpdateInstancePayload) ApiUpdateInstanceRequest { r.updateInstancePayload = &updateInstancePayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdateInstanceRequest) Execute() (*PartialUpdateInstanceResponse, error) { var ( localVarHTTPMethod = http.MethodPut @@ -4693,7 +4913,7 @@ func (r UpdateInstanceRequest) Execute() (*PartialUpdateInstanceResponse, error) /* UpdateInstance: Update Instance -Update available instance of a postgres database. Supported Versions are 12, 13, 14, 15 -- only upgrades are allowed! +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 Project ID @@ -4711,6 +4931,7 @@ func (a *APIClient) UpdateInstance(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) UpdateInstanceExecute(ctx context.Context, projectId string, region string, instanceId string) (*PartialUpdateInstanceResponse, error) { r := UpdateInstanceRequest{ apiService: a.defaultApi, @@ -4722,6 +4943,7 @@ func (a *APIClient) UpdateInstanceExecute(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 UpdateUserRequest struct { ctx context.Context apiService *DefaultApiService @@ -4733,12 +4955,13 @@ type UpdateUserRequest struct { } // The Request body only required in PUT endpoint. If empty request body is send via patch, then login and createdb roles are removed from user. The field - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdateUserRequest) UpdateUserPayload(updateUserPayload UpdateUserPayload) ApiUpdateUserRequest { r.updateUserPayload = &updateUserPayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdateUserRequest) Execute() error { var ( localVarHTTPMethod = http.MethodPut @@ -4857,7 +5080,7 @@ func (r UpdateUserRequest) Execute() error { /* UpdateUser: Update User -Update user for an instance. Only the roles are updatable. +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 ID of the project @@ -4877,6 +5100,7 @@ func (a *APIClient) UpdateUser(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) UpdateUserExecute(ctx context.Context, projectId string, region string, instanceId string, userId string) error { r := UpdateUserRequest{ apiService: a.defaultApi, diff --git a/services/postgresflex/client.go b/services/postgresflex/client.go index 72d4a2d73..9465cdfc9 100644 --- a/services/postgresflex/client.go +++ b/services/postgresflex/client.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -44,18 +45,21 @@ var ( // APIClient manages communication with the STACKIT PostgreSQL Flex API API v2.0.0 // 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() @@ -144,6 +148,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) @@ -282,6 +287,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 } @@ -592,6 +598,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/postgresflex/configuration.go b/services/postgresflex/configuration.go index dac5b74ec..1806a618c 100644 --- a/services/postgresflex/configuration.go +++ b/services/postgresflex/configuration.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex 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/postgresflex/go.mod b/services/postgresflex/go.mod index c574c6d6b..bff5cb116 100644 --- a/services/postgresflex/go.mod +++ b/services/postgresflex/go.mod @@ -4,7 +4,7 @@ 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/core v0.22.0 ) require ( diff --git a/services/postgresflex/go.sum b/services/postgresflex/go.sum index ca103c909..195011dd5 100644 --- a/services/postgresflex/go.sum +++ b/services/postgresflex/go.sum @@ -4,5 +4,5 @@ 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/core v0.22.0 h1:6rViz7GnNwXSh51Lur5xuDzO8EWSZfN9J0HvEkBKq6c= +github.com/stackitcloud/stackit-sdk-go/core v0.22.0/go.mod h1:osMglDby4csGZ5sIfhNyYq1bS1TxIdPY88+skE/kkmI= diff --git a/services/postgresflex/model_acl.go b/services/postgresflex/model_acl.go index 061496408..0967fe2a2 100644 --- a/services/postgresflex/model_acl.go +++ b/services/postgresflex/model_acl.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ACL{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ACLGetItemsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ACLGetItemsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ACLGetItemsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getACLGetItemsAttributeTypeOk(arg ACLGetItemsAttributeType) (ret ACLGetItemsRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getACLGetItemsAttributeTypeOk(arg ACLGetItemsAttributeType) (ret ACLGetItem return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setACLGetItemsAttributeType(arg *ACLGetItemsAttributeType, val ACLGetItemsRetType) { *arg = &val } // ACL struct for ACL +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ACL struct { Items ACLGetItemsAttributeType `json:"items,omitempty"` } @@ -46,6 +55,7 @@ type ACL 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 NewACL() *ACL { this := ACL{} return &this @@ -54,12 +64,14 @@ func NewACL() *ACL { // NewACLWithDefaults instantiates a new ACL object // This 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 NewACLWithDefaults() *ACL { this := ACL{} return &this } // GetItems returns the Items field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ACL) GetItems() (res ACLGetItemsRetType) { res, _ = o.GetItemsOk() return @@ -67,21 +79,25 @@ func (o *ACL) GetItems() (res ACLGetItemsRetType) { // GetItemsOk returns a tuple with the Items field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ACL) GetItemsOk() (ret ACLGetItemsRetType, ok bool) { return getACLGetItemsAttributeTypeOk(o.Items) } // HasItems returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ACL) HasItems() bool { _, ok := o.GetItemsOk() return ok } // SetItems gets a reference to the given []string and assigns it to the Items field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ACL) SetItems(v ACLGetItemsRetType) { setACLGetItemsAttributeType(&o.Items, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ACL) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getACLGetItemsAttributeTypeOk(o.Items); ok { @@ -90,37 +106,45 @@ func (o ACL) 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 NullableACL struct { value *ACL isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableACL) Get() *ACL { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableACL) Set(val *ACL) { 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 NullableACL) 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 *NullableACL) 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 NewNullableACL(val *ACL) *NullableACL { return &NullableACL{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 NullableACL) 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 *NullableACL) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_api_configuration.go b/services/postgresflex/model_api_configuration.go index 45a3c6e68..5885b94eb 100644 --- a/services/postgresflex/model_api_configuration.go +++ b/services/postgresflex/model_api_configuration.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &ApiConfiguration{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiConfigurationGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getApiConfigurationGetNameAttributeTypeOk(arg ApiConfigurationGetNameAttributeType) (ret ApiConfigurationGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getApiConfigurationGetNameAttributeTypeOk(arg ApiConfigurationGetNameAttrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setApiConfigurationGetNameAttributeType(arg *ApiConfigurationGetNameAttributeType, val ApiConfigurationGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiConfigurationGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiConfigurationGetNameRetType = string /* @@ -43,8 +50,10 @@ type ApiConfigurationGetNameRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiConfigurationGetSettingAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getApiConfigurationGetSettingAttributeTypeOk(arg ApiConfigurationGetSettingAttributeType) (ret ApiConfigurationGetSettingRetType, ok bool) { if arg == nil { return ret, false @@ -52,14 +61,19 @@ func getApiConfigurationGetSettingAttributeTypeOk(arg ApiConfigurationGetSetting return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setApiConfigurationGetSettingAttributeType(arg *ApiConfigurationGetSettingAttributeType, val ApiConfigurationGetSettingRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiConfigurationGetSettingArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiConfigurationGetSettingRetType = string // ApiConfiguration struct for ApiConfiguration +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiConfiguration struct { Name ApiConfigurationGetNameAttributeType `json:"name,omitempty"` Setting ApiConfigurationGetSettingAttributeType `json:"setting,omitempty"` @@ -69,6 +83,7 @@ type ApiConfiguration 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 NewApiConfiguration() *ApiConfiguration { this := ApiConfiguration{} return &this @@ -77,12 +92,14 @@ func NewApiConfiguration() *ApiConfiguration { // NewApiConfigurationWithDefaults instantiates a new ApiConfiguration object // This 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 NewApiConfigurationWithDefaults() *ApiConfiguration { this := ApiConfiguration{} 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 *ApiConfiguration) GetName() (res ApiConfigurationGetNameRetType) { res, _ = o.GetNameOk() return @@ -90,22 +107,26 @@ func (o *ApiConfiguration) GetName() (res ApiConfigurationGetNameRetType) { // 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 *ApiConfiguration) GetNameOk() (ret ApiConfigurationGetNameRetType, ok bool) { return getApiConfigurationGetNameAttributeTypeOk(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 *ApiConfiguration) 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 *ApiConfiguration) SetName(v ApiConfigurationGetNameRetType) { setApiConfigurationGetNameAttributeType(&o.Name, v) } // GetSetting returns the Setting field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ApiConfiguration) GetSetting() (res ApiConfigurationGetSettingRetType) { res, _ = o.GetSettingOk() return @@ -113,21 +134,25 @@ func (o *ApiConfiguration) GetSetting() (res ApiConfigurationGetSettingRetType) // GetSettingOk returns a tuple with the Setting field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ApiConfiguration) GetSettingOk() (ret ApiConfigurationGetSettingRetType, ok bool) { return getApiConfigurationGetSettingAttributeTypeOk(o.Setting) } // HasSetting returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ApiConfiguration) HasSetting() bool { _, ok := o.GetSettingOk() return ok } // SetSetting gets a reference to the given string and assigns it to the Setting field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ApiConfiguration) SetSetting(v ApiConfigurationGetSettingRetType) { setApiConfigurationGetSettingAttributeType(&o.Setting, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ApiConfiguration) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getApiConfigurationGetNameAttributeTypeOk(o.Name); ok { @@ -139,37 +164,45 @@ func (o ApiConfiguration) 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 NullableApiConfiguration struct { value *ApiConfiguration isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableApiConfiguration) Get() *ApiConfiguration { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableApiConfiguration) Set(val *ApiConfiguration) { 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 NullableApiConfiguration) 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 *NullableApiConfiguration) 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 NewNullableApiConfiguration(val *ApiConfiguration) *NullableApiConfiguration { return &NullableApiConfiguration{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 NullableApiConfiguration) 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 *NullableApiConfiguration) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_api_extension_config_load_response.go b/services/postgresflex/model_api_extension_config_load_response.go index 7ea6bf9f5..2c81066b8 100644 --- a/services/postgresflex/model_api_extension_config_load_response.go +++ b/services/postgresflex/model_api_extension_config_load_response.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ApiExtensionConfigLoadResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiExtensionConfigLoadResponseGetConfigurationAttributeType = *[]ApiConfiguration + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiExtensionConfigLoadResponseGetConfigurationArgType = []ApiConfiguration + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiExtensionConfigLoadResponseGetConfigurationRetType = []ApiConfiguration +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getApiExtensionConfigLoadResponseGetConfigurationAttributeTypeOk(arg ApiExtensionConfigLoadResponseGetConfigurationAttributeType) (ret ApiExtensionConfigLoadResponseGetConfigurationRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getApiExtensionConfigLoadResponseGetConfigurationAttributeTypeOk(arg ApiExt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setApiExtensionConfigLoadResponseGetConfigurationAttributeType(arg *ApiExtensionConfigLoadResponseGetConfigurationAttributeType, val ApiExtensionConfigLoadResponseGetConfigurationRetType) { *arg = &val } // ApiExtensionConfigLoadResponse struct for ApiExtensionConfigLoadResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiExtensionConfigLoadResponse struct { // Returns marshalled JSON of the new configuration of whatever extension is called Configuration ApiExtensionConfigLoadResponseGetConfigurationAttributeType `json:"configuration,omitempty"` @@ -47,6 +56,7 @@ type ApiExtensionConfigLoadResponse 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 NewApiExtensionConfigLoadResponse() *ApiExtensionConfigLoadResponse { this := ApiExtensionConfigLoadResponse{} return &this @@ -55,12 +65,14 @@ func NewApiExtensionConfigLoadResponse() *ApiExtensionConfigLoadResponse { // NewApiExtensionConfigLoadResponseWithDefaults instantiates a new ApiExtensionConfigLoadResponse object // This 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 NewApiExtensionConfigLoadResponseWithDefaults() *ApiExtensionConfigLoadResponse { this := ApiExtensionConfigLoadResponse{} return &this } // GetConfiguration returns the Configuration field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ApiExtensionConfigLoadResponse) GetConfiguration() (res ApiExtensionConfigLoadResponseGetConfigurationRetType) { res, _ = o.GetConfigurationOk() return @@ -68,21 +80,25 @@ func (o *ApiExtensionConfigLoadResponse) GetConfiguration() (res ApiExtensionCon // GetConfigurationOk returns a tuple with the Configuration field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ApiExtensionConfigLoadResponse) GetConfigurationOk() (ret ApiExtensionConfigLoadResponseGetConfigurationRetType, ok bool) { return getApiExtensionConfigLoadResponseGetConfigurationAttributeTypeOk(o.Configuration) } // HasConfiguration returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ApiExtensionConfigLoadResponse) HasConfiguration() bool { _, ok := o.GetConfigurationOk() return ok } // SetConfiguration gets a reference to the given []ApiConfiguration and assigns it to the Configuration field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ApiExtensionConfigLoadResponse) SetConfiguration(v ApiExtensionConfigLoadResponseGetConfigurationRetType) { setApiExtensionConfigLoadResponseGetConfigurationAttributeType(&o.Configuration, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ApiExtensionConfigLoadResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getApiExtensionConfigLoadResponseGetConfigurationAttributeTypeOk(o.Configuration); ok { @@ -91,37 +107,45 @@ func (o ApiExtensionConfigLoadResponse) 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 NullableApiExtensionConfigLoadResponse struct { value *ApiExtensionConfigLoadResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableApiExtensionConfigLoadResponse) Get() *ApiExtensionConfigLoadResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableApiExtensionConfigLoadResponse) Set(val *ApiExtensionConfigLoadResponse) { 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 NullableApiExtensionConfigLoadResponse) 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 *NullableApiExtensionConfigLoadResponse) 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 NewNullableApiExtensionConfigLoadResponse(val *ApiExtensionConfigLoadResponse) *NullableApiExtensionConfigLoadResponse { return &NullableApiExtensionConfigLoadResponse{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 NullableApiExtensionConfigLoadResponse) 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 *NullableApiExtensionConfigLoadResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_api_extension_configure_response.go b/services/postgresflex/model_api_extension_configure_response.go index e6d4cc6a2..6c5738683 100644 --- a/services/postgresflex/model_api_extension_configure_response.go +++ b/services/postgresflex/model_api_extension_configure_response.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ApiExtensionConfigureResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiExtensionConfigureResponseGetConfigurationAttributeType = *[]ApiConfiguration + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiExtensionConfigureResponseGetConfigurationArgType = []ApiConfiguration + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiExtensionConfigureResponseGetConfigurationRetType = []ApiConfiguration +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getApiExtensionConfigureResponseGetConfigurationAttributeTypeOk(arg ApiExtensionConfigureResponseGetConfigurationAttributeType) (ret ApiExtensionConfigureResponseGetConfigurationRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getApiExtensionConfigureResponseGetConfigurationAttributeTypeOk(arg ApiExte return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setApiExtensionConfigureResponseGetConfigurationAttributeType(arg *ApiExtensionConfigureResponseGetConfigurationAttributeType, val ApiExtensionConfigureResponseGetConfigurationRetType) { *arg = &val } // ApiExtensionConfigureResponse struct for ApiExtensionConfigureResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiExtensionConfigureResponse struct { // Returns marshalled JSON of the new configuration of whatever extension is called Configuration ApiExtensionConfigureResponseGetConfigurationAttributeType `json:"configuration,omitempty"` @@ -47,6 +56,7 @@ type ApiExtensionConfigureResponse 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 NewApiExtensionConfigureResponse() *ApiExtensionConfigureResponse { this := ApiExtensionConfigureResponse{} return &this @@ -55,12 +65,14 @@ func NewApiExtensionConfigureResponse() *ApiExtensionConfigureResponse { // NewApiExtensionConfigureResponseWithDefaults instantiates a new ApiExtensionConfigureResponse object // This 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 NewApiExtensionConfigureResponseWithDefaults() *ApiExtensionConfigureResponse { this := ApiExtensionConfigureResponse{} return &this } // GetConfiguration returns the Configuration field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ApiExtensionConfigureResponse) GetConfiguration() (res ApiExtensionConfigureResponseGetConfigurationRetType) { res, _ = o.GetConfigurationOk() return @@ -68,21 +80,25 @@ func (o *ApiExtensionConfigureResponse) GetConfiguration() (res ApiExtensionConf // GetConfigurationOk returns a tuple with the Configuration field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ApiExtensionConfigureResponse) GetConfigurationOk() (ret ApiExtensionConfigureResponseGetConfigurationRetType, ok bool) { return getApiExtensionConfigureResponseGetConfigurationAttributeTypeOk(o.Configuration) } // HasConfiguration returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ApiExtensionConfigureResponse) HasConfiguration() bool { _, ok := o.GetConfigurationOk() return ok } // SetConfiguration gets a reference to the given []ApiConfiguration and assigns it to the Configuration field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ApiExtensionConfigureResponse) SetConfiguration(v ApiExtensionConfigureResponseGetConfigurationRetType) { setApiExtensionConfigureResponseGetConfigurationAttributeType(&o.Configuration, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ApiExtensionConfigureResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getApiExtensionConfigureResponseGetConfigurationAttributeTypeOk(o.Configuration); ok { @@ -91,37 +107,45 @@ func (o ApiExtensionConfigureResponse) 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 NullableApiExtensionConfigureResponse struct { value *ApiExtensionConfigureResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableApiExtensionConfigureResponse) Get() *ApiExtensionConfigureResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableApiExtensionConfigureResponse) Set(val *ApiExtensionConfigureResponse) { 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 NullableApiExtensionConfigureResponse) 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 *NullableApiExtensionConfigureResponse) 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 NewNullableApiExtensionConfigureResponse(val *ApiExtensionConfigureResponse) *NullableApiExtensionConfigureResponse { return &NullableApiExtensionConfigureResponse{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 NullableApiExtensionConfigureResponse) 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 *NullableApiExtensionConfigureResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_api_extension_delete_response.go b/services/postgresflex/model_api_extension_delete_response.go index 1c2bdb238..9aeb39ef3 100644 --- a/services/postgresflex/model_api_extension_delete_response.go +++ b/services/postgresflex/model_api_extension_delete_response.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ApiExtensionDeleteResponse{} */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiExtensionDeleteResponsegetIsSuccededAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiExtensionDeleteResponsegetIsSuccededArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiExtensionDeleteResponsegetIsSuccededRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getApiExtensionDeleteResponsegetIsSuccededAttributeTypeOk(arg ApiExtensionDeleteResponsegetIsSuccededAttributeType) (ret ApiExtensionDeleteResponsegetIsSuccededRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getApiExtensionDeleteResponsegetIsSuccededAttributeTypeOk(arg ApiExtensionD return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setApiExtensionDeleteResponsegetIsSuccededAttributeType(arg *ApiExtensionDeleteResponsegetIsSuccededAttributeType, val ApiExtensionDeleteResponsegetIsSuccededRetType) { *arg = &val } // ApiExtensionDeleteResponse struct for ApiExtensionDeleteResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiExtensionDeleteResponse struct { IsSucceded ApiExtensionDeleteResponsegetIsSuccededAttributeType `json:"isSucceded,omitempty"` } @@ -46,6 +55,7 @@ type ApiExtensionDeleteResponse 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 NewApiExtensionDeleteResponse() *ApiExtensionDeleteResponse { this := ApiExtensionDeleteResponse{} return &this @@ -54,12 +64,14 @@ func NewApiExtensionDeleteResponse() *ApiExtensionDeleteResponse { // NewApiExtensionDeleteResponseWithDefaults instantiates a new ApiExtensionDeleteResponse object // This 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 NewApiExtensionDeleteResponseWithDefaults() *ApiExtensionDeleteResponse { this := ApiExtensionDeleteResponse{} return &this } // GetIsSucceded returns the IsSucceded field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ApiExtensionDeleteResponse) GetIsSucceded() (res ApiExtensionDeleteResponsegetIsSuccededRetType) { res, _ = o.GetIsSuccededOk() return @@ -67,21 +79,25 @@ func (o *ApiExtensionDeleteResponse) GetIsSucceded() (res ApiExtensionDeleteResp // GetIsSuccededOk returns a tuple with the IsSucceded field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ApiExtensionDeleteResponse) GetIsSuccededOk() (ret ApiExtensionDeleteResponsegetIsSuccededRetType, ok bool) { return getApiExtensionDeleteResponsegetIsSuccededAttributeTypeOk(o.IsSucceded) } // HasIsSucceded returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ApiExtensionDeleteResponse) HasIsSucceded() bool { _, ok := o.GetIsSuccededOk() return ok } // SetIsSucceded gets a reference to the given bool and assigns it to the IsSucceded field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ApiExtensionDeleteResponse) SetIsSucceded(v ApiExtensionDeleteResponsegetIsSuccededRetType) { setApiExtensionDeleteResponsegetIsSuccededAttributeType(&o.IsSucceded, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ApiExtensionDeleteResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getApiExtensionDeleteResponsegetIsSuccededAttributeTypeOk(o.IsSucceded); ok { @@ -90,37 +106,45 @@ func (o ApiExtensionDeleteResponse) 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 NullableApiExtensionDeleteResponse struct { value *ApiExtensionDeleteResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableApiExtensionDeleteResponse) Get() *ApiExtensionDeleteResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableApiExtensionDeleteResponse) Set(val *ApiExtensionDeleteResponse) { 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 NullableApiExtensionDeleteResponse) 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 *NullableApiExtensionDeleteResponse) 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 NewNullableApiExtensionDeleteResponse(val *ApiExtensionDeleteResponse) *NullableApiExtensionDeleteResponse { return &NullableApiExtensionDeleteResponse{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 NullableApiExtensionDeleteResponse) 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 *NullableApiExtensionDeleteResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_api_extension_list.go b/services/postgresflex/model_api_extension_list.go index baa2f37a3..0e6f4339f 100644 --- a/services/postgresflex/model_api_extension_list.go +++ b/services/postgresflex/model_api_extension_list.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ApiExtensionList{} */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiExtensionListGetIDAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiExtensionListGetIDArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiExtensionListGetIDRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getApiExtensionListGetIDAttributeTypeOk(arg ApiExtensionListGetIDAttributeType) (ret ApiExtensionListGetIDRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getApiExtensionListGetIDAttributeTypeOk(arg ApiExtensionListGetIDAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setApiExtensionListGetIDAttributeType(arg *ApiExtensionListGetIDAttributeType, val ApiExtensionListGetIDRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setApiExtensionListGetIDAttributeType(arg *ApiExtensionListGetIDAttributeTy */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiExtensionListGetDescriptionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getApiExtensionListGetDescriptionAttributeTypeOk(arg ApiExtensionListGetDescriptionAttributeType) (ret ApiExtensionListGetDescriptionRetType, ok bool) { if arg == nil { return ret, false @@ -51,11 +61,15 @@ func getApiExtensionListGetDescriptionAttributeTypeOk(arg ApiExtensionListGetDes return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setApiExtensionListGetDescriptionAttributeType(arg *ApiExtensionListGetDescriptionAttributeType, val ApiExtensionListGetDescriptionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiExtensionListGetDescriptionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiExtensionListGetDescriptionRetType = string /* @@ -63,8 +77,10 @@ type ApiExtensionListGetDescriptionRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiExtensionListGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getApiExtensionListGetNameAttributeTypeOk(arg ApiExtensionListGetNameAttributeType) (ret ApiExtensionListGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -72,14 +88,19 @@ func getApiExtensionListGetNameAttributeTypeOk(arg ApiExtensionListGetNameAttrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setApiExtensionListGetNameAttributeType(arg *ApiExtensionListGetNameAttributeType, val ApiExtensionListGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiExtensionListGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiExtensionListGetNameRetType = string // ApiExtensionList struct for ApiExtensionList +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiExtensionList struct { ID ApiExtensionListGetIDAttributeType `json:"ID,omitempty"` Description ApiExtensionListGetDescriptionAttributeType `json:"description,omitempty"` @@ -90,6 +111,7 @@ type ApiExtensionList 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 NewApiExtensionList() *ApiExtensionList { this := ApiExtensionList{} return &this @@ -98,12 +120,14 @@ func NewApiExtensionList() *ApiExtensionList { // NewApiExtensionListWithDefaults instantiates a new ApiExtensionList object // This 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 NewApiExtensionListWithDefaults() *ApiExtensionList { this := ApiExtensionList{} 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 *ApiExtensionList) GetID() (res ApiExtensionListGetIDRetType) { res, _ = o.GetIDOk() return @@ -111,22 +135,26 @@ func (o *ApiExtensionList) GetID() (res ApiExtensionListGetIDRetType) { // 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 *ApiExtensionList) GetIDOk() (ret ApiExtensionListGetIDRetType, ok bool) { return getApiExtensionListGetIDAttributeTypeOk(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 *ApiExtensionList) HasID() bool { _, ok := o.GetIDOk() return ok } // SetID gets a reference to the given int64 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 *ApiExtensionList) SetID(v ApiExtensionListGetIDRetType) { setApiExtensionListGetIDAttributeType(&o.ID, 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 *ApiExtensionList) GetDescription() (res ApiExtensionListGetDescriptionRetType) { res, _ = o.GetDescriptionOk() return @@ -134,22 +162,26 @@ func (o *ApiExtensionList) GetDescription() (res ApiExtensionListGetDescriptionR // 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 *ApiExtensionList) GetDescriptionOk() (ret ApiExtensionListGetDescriptionRetType, ok bool) { return getApiExtensionListGetDescriptionAttributeTypeOk(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 *ApiExtensionList) 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 *ApiExtensionList) SetDescription(v ApiExtensionListGetDescriptionRetType) { setApiExtensionListGetDescriptionAttributeType(&o.Description, 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 *ApiExtensionList) GetName() (res ApiExtensionListGetNameRetType) { res, _ = o.GetNameOk() return @@ -157,21 +189,25 @@ func (o *ApiExtensionList) GetName() (res ApiExtensionListGetNameRetType) { // 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 *ApiExtensionList) GetNameOk() (ret ApiExtensionListGetNameRetType, ok bool) { return getApiExtensionListGetNameAttributeTypeOk(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 *ApiExtensionList) 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 *ApiExtensionList) SetName(v ApiExtensionListGetNameRetType) { setApiExtensionListGetNameAttributeType(&o.Name, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ApiExtensionList) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getApiExtensionListGetIDAttributeTypeOk(o.ID); ok { @@ -186,37 +222,45 @@ func (o ApiExtensionList) 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 NullableApiExtensionList struct { value *ApiExtensionList isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableApiExtensionList) Get() *ApiExtensionList { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableApiExtensionList) Set(val *ApiExtensionList) { 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 NullableApiExtensionList) 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 *NullableApiExtensionList) 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 NewNullableApiExtensionList(val *ApiExtensionList) *NullableApiExtensionList { return &NullableApiExtensionList{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 NullableApiExtensionList) 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 *NullableApiExtensionList) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_api_extension_load_response.go b/services/postgresflex/model_api_extension_load_response.go index c92cb8830..1e8ec3dd7 100644 --- a/services/postgresflex/model_api_extension_load_response.go +++ b/services/postgresflex/model_api_extension_load_response.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ApiExtensionLoadResponse{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiExtensionLoadResponseGetExtensionAttributeType = *ApiExtensionList + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiExtensionLoadResponseGetExtensionArgType = ApiExtensionList + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiExtensionLoadResponseGetExtensionRetType = ApiExtensionList +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getApiExtensionLoadResponseGetExtensionAttributeTypeOk(arg ApiExtensionLoadResponseGetExtensionAttributeType) (ret ApiExtensionLoadResponseGetExtensionRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getApiExtensionLoadResponseGetExtensionAttributeTypeOk(arg ApiExtensionLoad return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setApiExtensionLoadResponseGetExtensionAttributeType(arg *ApiExtensionLoadResponseGetExtensionAttributeType, val ApiExtensionLoadResponseGetExtensionRetType) { *arg = &val } // ApiExtensionLoadResponse struct for ApiExtensionLoadResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiExtensionLoadResponse struct { Extension ApiExtensionLoadResponseGetExtensionAttributeType `json:"extension,omitempty"` } @@ -46,6 +55,7 @@ type ApiExtensionLoadResponse 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 NewApiExtensionLoadResponse() *ApiExtensionLoadResponse { this := ApiExtensionLoadResponse{} return &this @@ -54,12 +64,14 @@ func NewApiExtensionLoadResponse() *ApiExtensionLoadResponse { // NewApiExtensionLoadResponseWithDefaults instantiates a new ApiExtensionLoadResponse object // This 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 NewApiExtensionLoadResponseWithDefaults() *ApiExtensionLoadResponse { this := ApiExtensionLoadResponse{} return &this } // GetExtension returns the Extension field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ApiExtensionLoadResponse) GetExtension() (res ApiExtensionLoadResponseGetExtensionRetType) { res, _ = o.GetExtensionOk() return @@ -67,21 +79,25 @@ func (o *ApiExtensionLoadResponse) GetExtension() (res ApiExtensionLoadResponseG // GetExtensionOk returns a tuple with the Extension field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ApiExtensionLoadResponse) GetExtensionOk() (ret ApiExtensionLoadResponseGetExtensionRetType, ok bool) { return getApiExtensionLoadResponseGetExtensionAttributeTypeOk(o.Extension) } // HasExtension returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ApiExtensionLoadResponse) HasExtension() bool { _, ok := o.GetExtensionOk() return ok } // SetExtension gets a reference to the given ApiExtensionList and assigns it to the Extension field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ApiExtensionLoadResponse) SetExtension(v ApiExtensionLoadResponseGetExtensionRetType) { setApiExtensionLoadResponseGetExtensionAttributeType(&o.Extension, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ApiExtensionLoadResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getApiExtensionLoadResponseGetExtensionAttributeTypeOk(o.Extension); ok { @@ -90,37 +106,45 @@ func (o ApiExtensionLoadResponse) 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 NullableApiExtensionLoadResponse struct { value *ApiExtensionLoadResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableApiExtensionLoadResponse) Get() *ApiExtensionLoadResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableApiExtensionLoadResponse) Set(val *ApiExtensionLoadResponse) { 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 NullableApiExtensionLoadResponse) 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 *NullableApiExtensionLoadResponse) 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 NewNullableApiExtensionLoadResponse(val *ApiExtensionLoadResponse) *NullableApiExtensionLoadResponse { return &NullableApiExtensionLoadResponse{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 NullableApiExtensionLoadResponse) 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 *NullableApiExtensionLoadResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_api_install_response.go b/services/postgresflex/model_api_install_response.go index b51fe8ede..c4ff3fd5b 100644 --- a/services/postgresflex/model_api_install_response.go +++ b/services/postgresflex/model_api_install_response.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ApiInstallResponse{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiInstallResponseGetExtensionAttributeType = *ApiExtensionList + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiInstallResponseGetExtensionArgType = ApiExtensionList + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiInstallResponseGetExtensionRetType = ApiExtensionList +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getApiInstallResponseGetExtensionAttributeTypeOk(arg ApiInstallResponseGetExtensionAttributeType) (ret ApiInstallResponseGetExtensionRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getApiInstallResponseGetExtensionAttributeTypeOk(arg ApiInstallResponseGetE return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setApiInstallResponseGetExtensionAttributeType(arg *ApiInstallResponseGetExtensionAttributeType, val ApiInstallResponseGetExtensionRetType) { *arg = &val } // ApiInstallResponse struct for ApiInstallResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiInstallResponse struct { Extension ApiInstallResponseGetExtensionAttributeType `json:"extension,omitempty"` } @@ -46,6 +55,7 @@ type ApiInstallResponse 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 NewApiInstallResponse() *ApiInstallResponse { this := ApiInstallResponse{} return &this @@ -54,12 +64,14 @@ func NewApiInstallResponse() *ApiInstallResponse { // NewApiInstallResponseWithDefaults instantiates a new ApiInstallResponse object // This 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 NewApiInstallResponseWithDefaults() *ApiInstallResponse { this := ApiInstallResponse{} return &this } // GetExtension returns the Extension field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ApiInstallResponse) GetExtension() (res ApiInstallResponseGetExtensionRetType) { res, _ = o.GetExtensionOk() return @@ -67,21 +79,25 @@ func (o *ApiInstallResponse) GetExtension() (res ApiInstallResponseGetExtensionR // GetExtensionOk returns a tuple with the Extension field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ApiInstallResponse) GetExtensionOk() (ret ApiInstallResponseGetExtensionRetType, ok bool) { return getApiInstallResponseGetExtensionAttributeTypeOk(o.Extension) } // HasExtension returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ApiInstallResponse) HasExtension() bool { _, ok := o.GetExtensionOk() return ok } // SetExtension gets a reference to the given ApiExtensionList and assigns it to the Extension field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ApiInstallResponse) SetExtension(v ApiInstallResponseGetExtensionRetType) { setApiInstallResponseGetExtensionAttributeType(&o.Extension, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ApiInstallResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getApiInstallResponseGetExtensionAttributeTypeOk(o.Extension); ok { @@ -90,37 +106,45 @@ func (o ApiInstallResponse) 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 NullableApiInstallResponse struct { value *ApiInstallResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableApiInstallResponse) Get() *ApiInstallResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableApiInstallResponse) Set(val *ApiInstallResponse) { 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 NullableApiInstallResponse) 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 *NullableApiInstallResponse) 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 NewNullableApiInstallResponse(val *ApiInstallResponse) *NullableApiInstallResponse { return &NullableApiInstallResponse{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 NullableApiInstallResponse) 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 *NullableApiInstallResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_api_installed_list_response.go b/services/postgresflex/model_api_installed_list_response.go index af044bff8..4f3bacaea 100644 --- a/services/postgresflex/model_api_installed_list_response.go +++ b/services/postgresflex/model_api_installed_list_response.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ApiInstalledListResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiInstalledListResponseGetInstalledAttributeType = *[]ApiExtensionList + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiInstalledListResponseGetInstalledArgType = []ApiExtensionList + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiInstalledListResponseGetInstalledRetType = []ApiExtensionList +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getApiInstalledListResponseGetInstalledAttributeTypeOk(arg ApiInstalledListResponseGetInstalledAttributeType) (ret ApiInstalledListResponseGetInstalledRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getApiInstalledListResponseGetInstalledAttributeTypeOk(arg ApiInstalledList return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setApiInstalledListResponseGetInstalledAttributeType(arg *ApiInstalledListResponseGetInstalledAttributeType, val ApiInstalledListResponseGetInstalledRetType) { *arg = &val } // ApiInstalledListResponse struct for ApiInstalledListResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiInstalledListResponse struct { Installed ApiInstalledListResponseGetInstalledAttributeType `json:"installed,omitempty"` } @@ -46,6 +55,7 @@ type ApiInstalledListResponse 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 NewApiInstalledListResponse() *ApiInstalledListResponse { this := ApiInstalledListResponse{} return &this @@ -54,12 +64,14 @@ func NewApiInstalledListResponse() *ApiInstalledListResponse { // NewApiInstalledListResponseWithDefaults instantiates a new ApiInstalledListResponse object // This 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 NewApiInstalledListResponseWithDefaults() *ApiInstalledListResponse { this := ApiInstalledListResponse{} return &this } // GetInstalled returns the Installed field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ApiInstalledListResponse) GetInstalled() (res ApiInstalledListResponseGetInstalledRetType) { res, _ = o.GetInstalledOk() return @@ -67,21 +79,25 @@ func (o *ApiInstalledListResponse) GetInstalled() (res ApiInstalledListResponseG // GetInstalledOk returns a tuple with the Installed field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ApiInstalledListResponse) GetInstalledOk() (ret ApiInstalledListResponseGetInstalledRetType, ok bool) { return getApiInstalledListResponseGetInstalledAttributeTypeOk(o.Installed) } // HasInstalled returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ApiInstalledListResponse) HasInstalled() bool { _, ok := o.GetInstalledOk() return ok } // SetInstalled gets a reference to the given []ApiExtensionList and assigns it to the Installed field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ApiInstalledListResponse) SetInstalled(v ApiInstalledListResponseGetInstalledRetType) { setApiInstalledListResponseGetInstalledAttributeType(&o.Installed, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ApiInstalledListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getApiInstalledListResponseGetInstalledAttributeTypeOk(o.Installed); ok { @@ -90,37 +106,45 @@ func (o ApiInstalledListResponse) 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 NullableApiInstalledListResponse struct { value *ApiInstalledListResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableApiInstalledListResponse) Get() *ApiInstalledListResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableApiInstalledListResponse) Set(val *ApiInstalledListResponse) { 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 NullableApiInstalledListResponse) 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 *NullableApiInstalledListResponse) 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 NewNullableApiInstalledListResponse(val *ApiInstalledListResponse) *NullableApiInstalledListResponse { return &NullableApiInstalledListResponse{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 NullableApiInstalledListResponse) 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 *NullableApiInstalledListResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_backup.go b/services/postgresflex/model_backup.go index 18af8e99a..18fa82168 100644 --- a/services/postgresflex/model_backup.go +++ b/services/postgresflex/model_backup.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,8 +23,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 BackupGetEndTimeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupGetEndTimeAttributeTypeOk(arg BackupGetEndTimeAttributeType) (ret BackupGetEndTimeRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getBackupGetEndTimeAttributeTypeOk(arg BackupGetEndTimeAttributeType) (ret return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupGetEndTimeAttributeType(arg *BackupGetEndTimeAttributeType, val BackupGetEndTimeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetEndTimeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetEndTimeRetType = string /* @@ -43,8 +50,10 @@ type BackupGetEndTimeRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetErrorAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupGetErrorAttributeTypeOk(arg BackupGetErrorAttributeType) (ret BackupGetErrorRetType, ok bool) { if arg == nil { return ret, false @@ -52,11 +61,15 @@ func getBackupGetErrorAttributeTypeOk(arg BackupGetErrorAttributeType) (ret Back return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupGetErrorAttributeType(arg *BackupGetErrorAttributeType, val BackupGetErrorRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetErrorArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetErrorRetType = string /* @@ -64,8 +77,10 @@ type BackupGetErrorRetType = string */ // 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 @@ -73,11 +88,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 /* @@ -85,10 +104,16 @@ type BackupGetIdRetType = string */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetLabelsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetLabelsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetLabelsRetType = []string +// 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 @@ -96,6 +121,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 } @@ -105,8 +131,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 @@ -114,11 +142,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 /* @@ -126,10 +158,16 @@ type BackupGetNameRetType = string */ // isContainer +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetOptionsAttributeType = *map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetOptionsArgType = map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetOptionsRetType = map[string]string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupGetOptionsAttributeTypeOk(arg BackupGetOptionsAttributeType) (ret BackupGetOptionsRetType, ok bool) { if arg == nil { return ret, false @@ -137,6 +175,7 @@ func getBackupGetOptionsAttributeTypeOk(arg BackupGetOptionsAttributeType) (ret return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupGetOptionsAttributeType(arg *BackupGetOptionsAttributeType, val BackupGetOptionsRetType) { *arg = &val } @@ -146,10 +185,16 @@ func setBackupGetOptionsAttributeType(arg *BackupGetOptionsAttributeType, val Ba */ // 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 +202,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 +212,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 BackupGetStartTimeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupGetStartTimeAttributeTypeOk(arg BackupGetStartTimeAttributeType) (ret BackupGetStartTimeRetType, ok bool) { if arg == nil { return ret, false @@ -175,14 +223,19 @@ func getBackupGetStartTimeAttributeTypeOk(arg BackupGetStartTimeAttributeType) ( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupGetStartTimeAttributeType(arg *BackupGetStartTimeAttributeType, val BackupGetStartTimeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetStartTimeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetStartTimeRetType = string // Backup struct for Backup +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Backup struct { EndTime BackupGetEndTimeAttributeType `json:"endTime,omitempty"` Error BackupGetErrorAttributeType `json:"error,omitempty"` @@ -198,6 +251,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 @@ -206,12 +260,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 } // GetEndTime returns the EndTime field value if set, 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) GetEndTime() (res BackupGetEndTimeRetType) { res, _ = o.GetEndTimeOk() return @@ -219,22 +275,26 @@ func (o *Backup) GetEndTime() (res BackupGetEndTimeRetType) { // GetEndTimeOk returns a tuple with the EndTime field value if set, nil otherwise // and a boolean to check if the value 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) GetEndTimeOk() (ret BackupGetEndTimeRetType, ok bool) { return getBackupGetEndTimeAttributeTypeOk(o.EndTime) } // HasEndTime returns a boolean if a field 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) HasEndTime() bool { _, ok := o.GetEndTimeOk() return ok } // SetEndTime gets a reference to the given string and assigns it to the EndTime field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) SetEndTime(v BackupGetEndTimeRetType) { setBackupGetEndTimeAttributeType(&o.EndTime, v) } // GetError returns the Error field value if set, 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) GetError() (res BackupGetErrorRetType) { res, _ = o.GetErrorOk() return @@ -242,22 +302,26 @@ func (o *Backup) GetError() (res BackupGetErrorRetType) { // GetErrorOk returns a tuple with the Error field value if set, nil otherwise // and a boolean to check if the value 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) GetErrorOk() (ret BackupGetErrorRetType, ok bool) { return getBackupGetErrorAttributeTypeOk(o.Error) } // HasError returns a boolean if a field 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) HasError() bool { _, ok := o.GetErrorOk() return ok } // SetError gets a reference to the given string and assigns it to the Error field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) SetError(v BackupGetErrorRetType) { setBackupGetErrorAttributeType(&o.Error, 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 @@ -265,22 +329,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 @@ -288,22 +356,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 []string 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 @@ -311,22 +383,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) } // GetOptions returns the Options field value if set, 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) GetOptions() (res BackupGetOptionsRetType) { res, _ = o.GetOptionsOk() return @@ -334,22 +410,26 @@ func (o *Backup) GetOptions() (res BackupGetOptionsRetType) { // GetOptionsOk returns a tuple with the Options field value if set, nil otherwise // and a boolean to check if the value 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) GetOptionsOk() (ret BackupGetOptionsRetType, ok bool) { return getBackupGetOptionsAttributeTypeOk(o.Options) } // HasOptions returns a boolean if a field 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) HasOptions() bool { _, ok := o.GetOptionsOk() return ok } // SetOptions gets a reference to the given map[string]string and assigns it to the Options field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) SetOptions(v BackupGetOptionsRetType) { setBackupGetOptionsAttributeType(&o.Options, 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 @@ -357,22 +437,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) } // GetStartTime returns the StartTime field value if set, 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) GetStartTime() (res BackupGetStartTimeRetType) { res, _ = o.GetStartTimeOk() return @@ -380,21 +464,25 @@ func (o *Backup) GetStartTime() (res BackupGetStartTimeRetType) { // GetStartTimeOk returns a tuple with the StartTime field value if set, nil otherwise // and a boolean to check if the value 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) GetStartTimeOk() (ret BackupGetStartTimeRetType, ok bool) { return getBackupGetStartTimeAttributeTypeOk(o.StartTime) } // HasStartTime returns a boolean if a field 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) HasStartTime() bool { _, ok := o.GetStartTimeOk() return ok } // SetStartTime gets a reference to the given string and assigns it to the StartTime field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) SetStartTime(v BackupGetStartTimeRetType) { setBackupGetStartTimeAttributeType(&o.StartTime, 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 := getBackupGetEndTimeAttributeTypeOk(o.EndTime); ok { @@ -424,37 +512,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/postgresflex/model_clone_instance_payload.go b/services/postgresflex/model_clone_instance_payload.go index 5540810b6..b1f3bf05c 100644 --- a/services/postgresflex/model_clone_instance_payload.go +++ b/services/postgresflex/model_clone_instance_payload.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &CloneInstancePayload{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CloneInstancePayloadGetClassAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCloneInstancePayloadGetClassAttributeTypeOk(arg CloneInstancePayloadGetClassAttributeType) (ret CloneInstancePayloadGetClassRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getCloneInstancePayloadGetClassAttributeTypeOk(arg CloneInstancePayloadGetC return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCloneInstancePayloadGetClassAttributeType(arg *CloneInstancePayloadGetClassAttributeType, val CloneInstancePayloadGetClassRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CloneInstancePayloadGetClassArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CloneInstancePayloadGetClassRetType = string /* @@ -43,10 +50,16 @@ type CloneInstancePayloadGetClassRetType = string */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CloneInstancePayloadGetSizeAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CloneInstancePayloadGetSizeArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CloneInstancePayloadGetSizeRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCloneInstancePayloadGetSizeAttributeTypeOk(arg CloneInstancePayloadGetSizeAttributeType) (ret CloneInstancePayloadGetSizeRetType, ok bool) { if arg == nil { return ret, false @@ -54,6 +67,7 @@ func getCloneInstancePayloadGetSizeAttributeTypeOk(arg CloneInstancePayloadGetSi return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCloneInstancePayloadGetSizeAttributeType(arg *CloneInstancePayloadGetSizeAttributeType, val CloneInstancePayloadGetSizeRetType) { *arg = &val } @@ -63,8 +77,10 @@ func setCloneInstancePayloadGetSizeAttributeType(arg *CloneInstancePayloadGetSiz */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CloneInstancePayloadGetTimestampAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCloneInstancePayloadGetTimestampAttributeTypeOk(arg CloneInstancePayloadGetTimestampAttributeType) (ret CloneInstancePayloadGetTimestampRetType, ok bool) { if arg == nil { return ret, false @@ -72,14 +88,19 @@ func getCloneInstancePayloadGetTimestampAttributeTypeOk(arg CloneInstancePayload return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCloneInstancePayloadGetTimestampAttributeType(arg *CloneInstancePayloadGetTimestampAttributeType, val CloneInstancePayloadGetTimestampRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CloneInstancePayloadGetTimestampArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CloneInstancePayloadGetTimestampRetType = string // CloneInstancePayload struct for CloneInstancePayload +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CloneInstancePayload struct { Class CloneInstancePayloadGetClassAttributeType `json:"class,omitempty"` Size CloneInstancePayloadGetSizeAttributeType `json:"size,omitempty"` @@ -91,6 +112,7 @@ type CloneInstancePayload 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 NewCloneInstancePayload() *CloneInstancePayload { this := CloneInstancePayload{} return &this @@ -99,12 +121,14 @@ func NewCloneInstancePayload() *CloneInstancePayload { // NewCloneInstancePayloadWithDefaults instantiates a new CloneInstancePayload object // This 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 NewCloneInstancePayloadWithDefaults() *CloneInstancePayload { this := CloneInstancePayload{} return &this } // GetClass returns the Class field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CloneInstancePayload) GetClass() (res CloneInstancePayloadGetClassRetType) { res, _ = o.GetClassOk() return @@ -112,22 +136,26 @@ func (o *CloneInstancePayload) GetClass() (res CloneInstancePayloadGetClassRetTy // GetClassOk returns a tuple with the Class field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CloneInstancePayload) GetClassOk() (ret CloneInstancePayloadGetClassRetType, ok bool) { return getCloneInstancePayloadGetClassAttributeTypeOk(o.Class) } // HasClass returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CloneInstancePayload) HasClass() bool { _, ok := o.GetClassOk() return ok } // SetClass gets a reference to the given string and assigns it to the Class field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CloneInstancePayload) SetClass(v CloneInstancePayloadGetClassRetType) { setCloneInstancePayloadGetClassAttributeType(&o.Class, 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 *CloneInstancePayload) GetSize() (res CloneInstancePayloadGetSizeRetType) { res, _ = o.GetSizeOk() return @@ -135,22 +163,26 @@ func (o *CloneInstancePayload) GetSize() (res CloneInstancePayloadGetSizeRetType // 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 *CloneInstancePayload) GetSizeOk() (ret CloneInstancePayloadGetSizeRetType, ok bool) { return getCloneInstancePayloadGetSizeAttributeTypeOk(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 *CloneInstancePayload) 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 *CloneInstancePayload) SetSize(v CloneInstancePayloadGetSizeRetType) { setCloneInstancePayloadGetSizeAttributeType(&o.Size, v) } // GetTimestamp returns the Timestamp field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CloneInstancePayload) GetTimestamp() (res CloneInstancePayloadGetTimestampRetType) { res, _ = o.GetTimestampOk() return @@ -158,21 +190,25 @@ func (o *CloneInstancePayload) GetTimestamp() (res CloneInstancePayloadGetTimest // GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CloneInstancePayload) GetTimestampOk() (ret CloneInstancePayloadGetTimestampRetType, ok bool) { return getCloneInstancePayloadGetTimestampAttributeTypeOk(o.Timestamp) } // HasTimestamp returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CloneInstancePayload) HasTimestamp() bool { _, ok := o.GetTimestampOk() return ok } // SetTimestamp gets a reference to the given string and assigns it to the Timestamp field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CloneInstancePayload) SetTimestamp(v CloneInstancePayloadGetTimestampRetType) { setCloneInstancePayloadGetTimestampAttributeType(&o.Timestamp, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CloneInstancePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCloneInstancePayloadGetClassAttributeTypeOk(o.Class); ok { @@ -187,37 +223,45 @@ func (o CloneInstancePayload) 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 NullableCloneInstancePayload struct { value *CloneInstancePayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCloneInstancePayload) Get() *CloneInstancePayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCloneInstancePayload) Set(val *CloneInstancePayload) { 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 NullableCloneInstancePayload) 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 *NullableCloneInstancePayload) 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 NewNullableCloneInstancePayload(val *CloneInstancePayload) *NullableCloneInstancePayload { return &NullableCloneInstancePayload{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 NullableCloneInstancePayload) 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 *NullableCloneInstancePayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_clone_instance_response.go b/services/postgresflex/model_clone_instance_response.go index fa458670d..317811079 100644 --- a/services/postgresflex/model_clone_instance_response.go +++ b/services/postgresflex/model_clone_instance_response.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &CloneInstanceResponse{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CloneInstanceResponseGetInstanceIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCloneInstanceResponseGetInstanceIdAttributeTypeOk(arg CloneInstanceResponseGetInstanceIdAttributeType) (ret CloneInstanceResponseGetInstanceIdRetType, ok bool) { if arg == nil { return ret, false @@ -31,14 +34,19 @@ func getCloneInstanceResponseGetInstanceIdAttributeTypeOk(arg CloneInstanceRespo return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCloneInstanceResponseGetInstanceIdAttributeType(arg *CloneInstanceResponseGetInstanceIdAttributeType, val CloneInstanceResponseGetInstanceIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CloneInstanceResponseGetInstanceIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CloneInstanceResponseGetInstanceIdRetType = string // CloneInstanceResponse struct for CloneInstanceResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CloneInstanceResponse struct { InstanceId CloneInstanceResponseGetInstanceIdAttributeType `json:"instanceId,omitempty"` } @@ -47,6 +55,7 @@ type CloneInstanceResponse 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 NewCloneInstanceResponse() *CloneInstanceResponse { this := CloneInstanceResponse{} return &this @@ -55,12 +64,14 @@ func NewCloneInstanceResponse() *CloneInstanceResponse { // NewCloneInstanceResponseWithDefaults instantiates a new CloneInstanceResponse object // This 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 NewCloneInstanceResponseWithDefaults() *CloneInstanceResponse { this := CloneInstanceResponse{} return &this } // GetInstanceId returns the InstanceId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CloneInstanceResponse) GetInstanceId() (res CloneInstanceResponseGetInstanceIdRetType) { res, _ = o.GetInstanceIdOk() return @@ -68,21 +79,25 @@ func (o *CloneInstanceResponse) GetInstanceId() (res CloneInstanceResponseGetIns // GetInstanceIdOk returns a tuple with the InstanceId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CloneInstanceResponse) GetInstanceIdOk() (ret CloneInstanceResponseGetInstanceIdRetType, ok bool) { return getCloneInstanceResponseGetInstanceIdAttributeTypeOk(o.InstanceId) } // HasInstanceId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CloneInstanceResponse) HasInstanceId() bool { _, ok := o.GetInstanceIdOk() return ok } // SetInstanceId gets a reference to the given string and assigns it to the InstanceId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CloneInstanceResponse) SetInstanceId(v CloneInstanceResponseGetInstanceIdRetType) { setCloneInstanceResponseGetInstanceIdAttributeType(&o.InstanceId, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CloneInstanceResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCloneInstanceResponseGetInstanceIdAttributeTypeOk(o.InstanceId); ok { @@ -91,37 +106,45 @@ func (o CloneInstanceResponse) 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 NullableCloneInstanceResponse struct { value *CloneInstanceResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCloneInstanceResponse) Get() *CloneInstanceResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCloneInstanceResponse) Set(val *CloneInstanceResponse) { 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 NullableCloneInstanceResponse) 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 *NullableCloneInstanceResponse) 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 NewNullableCloneInstanceResponse(val *CloneInstanceResponse) *NullableCloneInstanceResponse { return &NullableCloneInstanceResponse{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 NullableCloneInstanceResponse) 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 *NullableCloneInstanceResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_create_database_payload.go b/services/postgresflex/model_create_database_payload.go index 9b00606a6..7956b9c71 100644 --- a/services/postgresflex/model_create_database_payload.go +++ b/services/postgresflex/model_create_database_payload.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &CreateDatabasePayload{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDatabasePayloadGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateDatabasePayloadGetNameAttributeTypeOk(arg CreateDatabasePayloadGetNameAttributeType) (ret CreateDatabasePayloadGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getCreateDatabasePayloadGetNameAttributeTypeOk(arg CreateDatabasePayloadGet return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateDatabasePayloadGetNameAttributeType(arg *CreateDatabasePayloadGetNameAttributeType, val CreateDatabasePayloadGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDatabasePayloadGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDatabasePayloadGetNameRetType = string /* @@ -43,10 +50,16 @@ type CreateDatabasePayloadGetNameRetType = string */ // isContainer +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDatabasePayloadGetOptionsAttributeType = *map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDatabasePayloadGetOptionsArgType = map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDatabasePayloadGetOptionsRetType = map[string]string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateDatabasePayloadGetOptionsAttributeTypeOk(arg CreateDatabasePayloadGetOptionsAttributeType) (ret CreateDatabasePayloadGetOptionsRetType, ok bool) { if arg == nil { return ret, false @@ -54,11 +67,13 @@ func getCreateDatabasePayloadGetOptionsAttributeTypeOk(arg CreateDatabasePayload return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateDatabasePayloadGetOptionsAttributeType(arg *CreateDatabasePayloadGetOptionsAttributeType, val CreateDatabasePayloadGetOptionsRetType) { *arg = &val } // CreateDatabasePayload struct for CreateDatabasePayload +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDatabasePayload struct { Name CreateDatabasePayloadGetNameAttributeType `json:"name,omitempty"` // Database specific options @@ -69,6 +84,7 @@ type CreateDatabasePayload 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 NewCreateDatabasePayload() *CreateDatabasePayload { this := CreateDatabasePayload{} return &this @@ -77,12 +93,14 @@ func NewCreateDatabasePayload() *CreateDatabasePayload { // NewCreateDatabasePayloadWithDefaults instantiates a new CreateDatabasePayload object // This 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 NewCreateDatabasePayloadWithDefaults() *CreateDatabasePayload { this := CreateDatabasePayload{} 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 *CreateDatabasePayload) GetName() (res CreateDatabasePayloadGetNameRetType) { res, _ = o.GetNameOk() return @@ -90,22 +108,26 @@ func (o *CreateDatabasePayload) GetName() (res CreateDatabasePayloadGetNameRetTy // 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 *CreateDatabasePayload) GetNameOk() (ret CreateDatabasePayloadGetNameRetType, ok bool) { return getCreateDatabasePayloadGetNameAttributeTypeOk(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 *CreateDatabasePayload) 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 *CreateDatabasePayload) SetName(v CreateDatabasePayloadGetNameRetType) { setCreateDatabasePayloadGetNameAttributeType(&o.Name, v) } // GetOptions returns the Options field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDatabasePayload) GetOptions() (res CreateDatabasePayloadGetOptionsRetType) { res, _ = o.GetOptionsOk() return @@ -113,21 +135,25 @@ func (o *CreateDatabasePayload) GetOptions() (res CreateDatabasePayloadGetOption // GetOptionsOk returns a tuple with the Options field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDatabasePayload) GetOptionsOk() (ret CreateDatabasePayloadGetOptionsRetType, ok bool) { return getCreateDatabasePayloadGetOptionsAttributeTypeOk(o.Options) } // HasOptions returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDatabasePayload) HasOptions() bool { _, ok := o.GetOptionsOk() return ok } // SetOptions gets a reference to the given map[string]string and assigns it to the Options field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDatabasePayload) SetOptions(v CreateDatabasePayloadGetOptionsRetType) { setCreateDatabasePayloadGetOptionsAttributeType(&o.Options, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateDatabasePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateDatabasePayloadGetNameAttributeTypeOk(o.Name); ok { @@ -139,37 +165,45 @@ func (o CreateDatabasePayload) 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 NullableCreateDatabasePayload struct { value *CreateDatabasePayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateDatabasePayload) Get() *CreateDatabasePayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateDatabasePayload) Set(val *CreateDatabasePayload) { 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 NullableCreateDatabasePayload) 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 *NullableCreateDatabasePayload) 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 NewNullableCreateDatabasePayload(val *CreateDatabasePayload) *NullableCreateDatabasePayload { return &NullableCreateDatabasePayload{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 NullableCreateDatabasePayload) 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 *NullableCreateDatabasePayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_create_instance_payload.go b/services/postgresflex/model_create_instance_payload.go index f99eeb859..67ec299f8 100644 --- a/services/postgresflex/model_create_instance_payload.go +++ b/services/postgresflex/model_create_instance_payload.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &CreateInstancePayload{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetAclAttributeType = *ACL + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetAclArgType = ACL + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetAclRetType = ACL +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateInstancePayloadGetAclAttributeTypeOk(arg CreateInstancePayloadGetAclAttributeType) (ret CreateInstancePayloadGetAclRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getCreateInstancePayloadGetAclAttributeTypeOk(arg CreateInstancePayloadGetA return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateInstancePayloadGetAclAttributeType(arg *CreateInstancePayloadGetAclAttributeType, val CreateInstancePayloadGetAclRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setCreateInstancePayloadGetAclAttributeType(arg *CreateInstancePayloadGetAc */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetBackupScheduleAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateInstancePayloadGetBackupScheduleAttributeTypeOk(arg CreateInstancePayloadGetBackupScheduleAttributeType) (ret CreateInstancePayloadGetBackupScheduleRetType, ok bool) { if arg == nil { return ret, false @@ -51,11 +61,15 @@ func getCreateInstancePayloadGetBackupScheduleAttributeTypeOk(arg CreateInstance return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateInstancePayloadGetBackupScheduleAttributeType(arg *CreateInstancePayloadGetBackupScheduleAttributeType, val CreateInstancePayloadGetBackupScheduleRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetBackupScheduleArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetBackupScheduleRetType = string /* @@ -63,8 +77,10 @@ type CreateInstancePayloadGetBackupScheduleRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetFlavorIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateInstancePayloadGetFlavorIdAttributeTypeOk(arg CreateInstancePayloadGetFlavorIdAttributeType) (ret CreateInstancePayloadGetFlavorIdRetType, ok bool) { if arg == nil { return ret, false @@ -72,11 +88,15 @@ func getCreateInstancePayloadGetFlavorIdAttributeTypeOk(arg CreateInstancePayloa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateInstancePayloadGetFlavorIdAttributeType(arg *CreateInstancePayloadGetFlavorIdAttributeType, val CreateInstancePayloadGetFlavorIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetFlavorIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetFlavorIdRetType = string /* @@ -84,10 +104,16 @@ type CreateInstancePayloadGetFlavorIdRetType = string */ // isContainer +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetLabelsAttributeType = *map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetLabelsArgType = map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetLabelsRetType = map[string]string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateInstancePayloadGetLabelsAttributeTypeOk(arg CreateInstancePayloadGetLabelsAttributeType) (ret CreateInstancePayloadGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -95,6 +121,7 @@ func getCreateInstancePayloadGetLabelsAttributeTypeOk(arg CreateInstancePayloadG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateInstancePayloadGetLabelsAttributeType(arg *CreateInstancePayloadGetLabelsAttributeType, val CreateInstancePayloadGetLabelsRetType) { *arg = &val } @@ -104,8 +131,10 @@ func setCreateInstancePayloadGetLabelsAttributeType(arg *CreateInstancePayloadGe */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateInstancePayloadGetNameAttributeTypeOk(arg CreateInstancePayloadGetNameAttributeType) (ret CreateInstancePayloadGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -113,11 +142,15 @@ func getCreateInstancePayloadGetNameAttributeTypeOk(arg CreateInstancePayloadGet return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateInstancePayloadGetNameAttributeType(arg *CreateInstancePayloadGetNameAttributeType, val CreateInstancePayloadGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetNameRetType = string /* @@ -125,10 +158,16 @@ type CreateInstancePayloadGetNameRetType = string */ // isContainer +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetOptionsAttributeType = *map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetOptionsArgType = map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetOptionsRetType = map[string]string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateInstancePayloadGetOptionsAttributeTypeOk(arg CreateInstancePayloadGetOptionsAttributeType) (ret CreateInstancePayloadGetOptionsRetType, ok bool) { if arg == nil { return ret, false @@ -136,6 +175,7 @@ func getCreateInstancePayloadGetOptionsAttributeTypeOk(arg CreateInstancePayload return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateInstancePayloadGetOptionsAttributeType(arg *CreateInstancePayloadGetOptionsAttributeType, val CreateInstancePayloadGetOptionsRetType) { *arg = &val } @@ -145,10 +185,16 @@ func setCreateInstancePayloadGetOptionsAttributeType(arg *CreateInstancePayloadG */ // isInteger +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetReplicasAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetReplicasArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetReplicasRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateInstancePayloadGetReplicasAttributeTypeOk(arg CreateInstancePayloadGetReplicasAttributeType) (ret CreateInstancePayloadGetReplicasRetType, ok bool) { if arg == nil { return ret, false @@ -156,6 +202,7 @@ func getCreateInstancePayloadGetReplicasAttributeTypeOk(arg CreateInstancePayloa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateInstancePayloadGetReplicasAttributeType(arg *CreateInstancePayloadGetReplicasAttributeType, val CreateInstancePayloadGetReplicasRetType) { *arg = &val } @@ -165,10 +212,16 @@ func setCreateInstancePayloadGetReplicasAttributeType(arg *CreateInstancePayload */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetStorageAttributeType = *Storage + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetStorageArgType = Storage + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetStorageRetType = Storage +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateInstancePayloadGetStorageAttributeTypeOk(arg CreateInstancePayloadGetStorageAttributeType) (ret CreateInstancePayloadGetStorageRetType, ok bool) { if arg == nil { return ret, false @@ -176,6 +229,7 @@ func getCreateInstancePayloadGetStorageAttributeTypeOk(arg CreateInstancePayload return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateInstancePayloadGetStorageAttributeType(arg *CreateInstancePayloadGetStorageAttributeType, val CreateInstancePayloadGetStorageRetType) { *arg = &val } @@ -185,8 +239,10 @@ func setCreateInstancePayloadGetStorageAttributeType(arg *CreateInstancePayloadG */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetVersionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateInstancePayloadGetVersionAttributeTypeOk(arg CreateInstancePayloadGetVersionAttributeType) (ret CreateInstancePayloadGetVersionRetType, ok bool) { if arg == nil { return ret, false @@ -194,14 +250,19 @@ func getCreateInstancePayloadGetVersionAttributeTypeOk(arg CreateInstancePayload return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateInstancePayloadGetVersionAttributeType(arg *CreateInstancePayloadGetVersionAttributeType, val CreateInstancePayloadGetVersionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetVersionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetVersionRetType = string // CreateInstancePayload struct for CreateInstancePayload +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayload struct { // REQUIRED Acl CreateInstancePayloadGetAclAttributeType `json:"acl" required:"true"` @@ -224,12 +285,14 @@ type CreateInstancePayload struct { Version CreateInstancePayloadGetVersionAttributeType `json:"version" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _CreateInstancePayload CreateInstancePayload // NewCreateInstancePayload instantiates a new CreateInstancePayload object // This constructor will assign default values to properties that have it defined, // 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 NewCreateInstancePayload(acl CreateInstancePayloadGetAclArgType, backupSchedule CreateInstancePayloadGetBackupScheduleArgType, flavorId CreateInstancePayloadGetFlavorIdArgType, name CreateInstancePayloadGetNameArgType, options CreateInstancePayloadGetOptionsArgType, replicas CreateInstancePayloadGetReplicasArgType, storage CreateInstancePayloadGetStorageArgType, version CreateInstancePayloadGetVersionArgType) *CreateInstancePayload { this := CreateInstancePayload{} setCreateInstancePayloadGetAclAttributeType(&this.Acl, acl) @@ -246,12 +309,14 @@ func NewCreateInstancePayload(acl CreateInstancePayloadGetAclArgType, backupSche // NewCreateInstancePayloadWithDefaults instantiates a new CreateInstancePayload object // This 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 NewCreateInstancePayloadWithDefaults() *CreateInstancePayload { this := CreateInstancePayload{} return &this } // GetAcl returns the Acl field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateInstancePayload) GetAcl() (ret CreateInstancePayloadGetAclRetType) { ret, _ = o.GetAclOk() return ret @@ -259,16 +324,19 @@ func (o *CreateInstancePayload) GetAcl() (ret CreateInstancePayloadGetAclRetType // GetAclOk returns a tuple with the Acl 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 *CreateInstancePayload) GetAclOk() (ret CreateInstancePayloadGetAclRetType, ok bool) { return getCreateInstancePayloadGetAclAttributeTypeOk(o.Acl) } // SetAcl sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateInstancePayload) SetAcl(v CreateInstancePayloadGetAclRetType) { setCreateInstancePayloadGetAclAttributeType(&o.Acl, v) } // GetBackupSchedule returns the BackupSchedule field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateInstancePayload) GetBackupSchedule() (ret CreateInstancePayloadGetBackupScheduleRetType) { ret, _ = o.GetBackupScheduleOk() return ret @@ -276,16 +344,19 @@ func (o *CreateInstancePayload) GetBackupSchedule() (ret CreateInstancePayloadGe // GetBackupScheduleOk returns a tuple with the BackupSchedule 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 *CreateInstancePayload) GetBackupScheduleOk() (ret CreateInstancePayloadGetBackupScheduleRetType, ok bool) { return getCreateInstancePayloadGetBackupScheduleAttributeTypeOk(o.BackupSchedule) } // SetBackupSchedule sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateInstancePayload) SetBackupSchedule(v CreateInstancePayloadGetBackupScheduleRetType) { setCreateInstancePayloadGetBackupScheduleAttributeType(&o.BackupSchedule, v) } // GetFlavorId returns the FlavorId field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateInstancePayload) GetFlavorId() (ret CreateInstancePayloadGetFlavorIdRetType) { ret, _ = o.GetFlavorIdOk() return ret @@ -293,16 +364,19 @@ func (o *CreateInstancePayload) GetFlavorId() (ret CreateInstancePayloadGetFlavo // GetFlavorIdOk returns a tuple with the FlavorId 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 *CreateInstancePayload) GetFlavorIdOk() (ret CreateInstancePayloadGetFlavorIdRetType, ok bool) { return getCreateInstancePayloadGetFlavorIdAttributeTypeOk(o.FlavorId) } // SetFlavorId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateInstancePayload) SetFlavorId(v CreateInstancePayloadGetFlavorIdRetType) { setCreateInstancePayloadGetFlavorIdAttributeType(&o.FlavorId, 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 *CreateInstancePayload) GetLabels() (res CreateInstancePayloadGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -310,22 +384,26 @@ func (o *CreateInstancePayload) GetLabels() (res CreateInstancePayloadGetLabelsR // 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 *CreateInstancePayload) GetLabelsOk() (ret CreateInstancePayloadGetLabelsRetType, ok bool) { return getCreateInstancePayloadGetLabelsAttributeTypeOk(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 *CreateInstancePayload) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]string 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 *CreateInstancePayload) SetLabels(v CreateInstancePayloadGetLabelsRetType) { setCreateInstancePayloadGetLabelsAttributeType(&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 *CreateInstancePayload) GetName() (ret CreateInstancePayloadGetNameRetType) { ret, _ = o.GetNameOk() return ret @@ -333,16 +411,19 @@ func (o *CreateInstancePayload) GetName() (ret CreateInstancePayloadGetNameRetTy // 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 *CreateInstancePayload) GetNameOk() (ret CreateInstancePayloadGetNameRetType, ok bool) { return getCreateInstancePayloadGetNameAttributeTypeOk(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 *CreateInstancePayload) SetName(v CreateInstancePayloadGetNameRetType) { setCreateInstancePayloadGetNameAttributeType(&o.Name, v) } // GetOptions returns the Options field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateInstancePayload) GetOptions() (ret CreateInstancePayloadGetOptionsRetType) { ret, _ = o.GetOptionsOk() return ret @@ -350,16 +431,19 @@ func (o *CreateInstancePayload) GetOptions() (ret CreateInstancePayloadGetOption // GetOptionsOk returns a tuple with the Options 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 *CreateInstancePayload) GetOptionsOk() (ret CreateInstancePayloadGetOptionsRetType, ok bool) { return getCreateInstancePayloadGetOptionsAttributeTypeOk(o.Options) } // SetOptions sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateInstancePayload) SetOptions(v CreateInstancePayloadGetOptionsRetType) { setCreateInstancePayloadGetOptionsAttributeType(&o.Options, v) } // GetReplicas returns the Replicas field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateInstancePayload) GetReplicas() (ret CreateInstancePayloadGetReplicasRetType) { ret, _ = o.GetReplicasOk() return ret @@ -367,16 +451,19 @@ func (o *CreateInstancePayload) GetReplicas() (ret CreateInstancePayloadGetRepli // GetReplicasOk returns a tuple with the Replicas 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 *CreateInstancePayload) GetReplicasOk() (ret CreateInstancePayloadGetReplicasRetType, ok bool) { return getCreateInstancePayloadGetReplicasAttributeTypeOk(o.Replicas) } // SetReplicas sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateInstancePayload) SetReplicas(v CreateInstancePayloadGetReplicasRetType) { setCreateInstancePayloadGetReplicasAttributeType(&o.Replicas, v) } // GetStorage returns the Storage field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateInstancePayload) GetStorage() (ret CreateInstancePayloadGetStorageRetType) { ret, _ = o.GetStorageOk() return ret @@ -384,16 +471,19 @@ func (o *CreateInstancePayload) GetStorage() (ret CreateInstancePayloadGetStorag // GetStorageOk returns a tuple with the Storage 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 *CreateInstancePayload) GetStorageOk() (ret CreateInstancePayloadGetStorageRetType, ok bool) { return getCreateInstancePayloadGetStorageAttributeTypeOk(o.Storage) } // SetStorage sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateInstancePayload) SetStorage(v CreateInstancePayloadGetStorageRetType) { setCreateInstancePayloadGetStorageAttributeType(&o.Storage, v) } // GetVersion returns the Version field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateInstancePayload) GetVersion() (ret CreateInstancePayloadGetVersionRetType) { ret, _ = o.GetVersionOk() return ret @@ -401,15 +491,18 @@ func (o *CreateInstancePayload) GetVersion() (ret CreateInstancePayloadGetVersio // GetVersionOk returns a tuple with the Version 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 *CreateInstancePayload) GetVersionOk() (ret CreateInstancePayloadGetVersionRetType, ok bool) { return getCreateInstancePayloadGetVersionAttributeTypeOk(o.Version) } // SetVersion sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateInstancePayload) SetVersion(v CreateInstancePayloadGetVersionRetType) { setCreateInstancePayloadGetVersionAttributeType(&o.Version, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateInstancePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateInstancePayloadGetAclAttributeTypeOk(o.Acl); ok { @@ -442,37 +535,45 @@ func (o CreateInstancePayload) 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 NullableCreateInstancePayload struct { value *CreateInstancePayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateInstancePayload) Get() *CreateInstancePayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateInstancePayload) Set(val *CreateInstancePayload) { 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 NullableCreateInstancePayload) 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 *NullableCreateInstancePayload) 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 NewNullableCreateInstancePayload(val *CreateInstancePayload) *NullableCreateInstancePayload { return &NullableCreateInstancePayload{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 NullableCreateInstancePayload) 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 *NullableCreateInstancePayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_create_instance_response.go b/services/postgresflex/model_create_instance_response.go index 394c6fdef..0237cc054 100644 --- a/services/postgresflex/model_create_instance_response.go +++ b/services/postgresflex/model_create_instance_response.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &CreateInstanceResponse{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstanceResponseGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateInstanceResponseGetIdAttributeTypeOk(arg CreateInstanceResponseGetIdAttributeType) (ret CreateInstanceResponseGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -31,14 +34,19 @@ func getCreateInstanceResponseGetIdAttributeTypeOk(arg CreateInstanceResponseGet return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateInstanceResponseGetIdAttributeType(arg *CreateInstanceResponseGetIdAttributeType, val CreateInstanceResponseGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstanceResponseGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstanceResponseGetIdRetType = string // CreateInstanceResponse struct for CreateInstanceResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstanceResponse struct { Id CreateInstanceResponseGetIdAttributeType `json:"id,omitempty"` } @@ -47,6 +55,7 @@ type CreateInstanceResponse 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 NewCreateInstanceResponse() *CreateInstanceResponse { this := CreateInstanceResponse{} return &this @@ -55,12 +64,14 @@ func NewCreateInstanceResponse() *CreateInstanceResponse { // NewCreateInstanceResponseWithDefaults instantiates a new CreateInstanceResponse object // This 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 NewCreateInstanceResponseWithDefaults() *CreateInstanceResponse { this := CreateInstanceResponse{} 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 *CreateInstanceResponse) GetId() (res CreateInstanceResponseGetIdRetType) { res, _ = o.GetIdOk() return @@ -68,21 +79,25 @@ func (o *CreateInstanceResponse) GetId() (res CreateInstanceResponseGetIdRetType // 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 *CreateInstanceResponse) GetIdOk() (ret CreateInstanceResponseGetIdRetType, ok bool) { return getCreateInstanceResponseGetIdAttributeTypeOk(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 *CreateInstanceResponse) 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 *CreateInstanceResponse) SetId(v CreateInstanceResponseGetIdRetType) { setCreateInstanceResponseGetIdAttributeType(&o.Id, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateInstanceResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateInstanceResponseGetIdAttributeTypeOk(o.Id); ok { @@ -91,37 +106,45 @@ func (o CreateInstanceResponse) 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 NullableCreateInstanceResponse struct { value *CreateInstanceResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateInstanceResponse) Get() *CreateInstanceResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateInstanceResponse) Set(val *CreateInstanceResponse) { 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 NullableCreateInstanceResponse) 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 *NullableCreateInstanceResponse) 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 NewNullableCreateInstanceResponse(val *CreateInstanceResponse) *NullableCreateInstanceResponse { return &NullableCreateInstanceResponse{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 NullableCreateInstanceResponse) 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 *NullableCreateInstanceResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_create_user_payload.go b/services/postgresflex/model_create_user_payload.go index 6ea341a80..06f461801 100644 --- a/services/postgresflex/model_create_user_payload.go +++ b/services/postgresflex/model_create_user_payload.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &CreateUserPayload{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateUserPayloadGetRolesAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateUserPayloadGetRolesArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateUserPayloadGetRolesRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateUserPayloadGetRolesAttributeTypeOk(arg CreateUserPayloadGetRolesAttributeType) (ret CreateUserPayloadGetRolesRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getCreateUserPayloadGetRolesAttributeTypeOk(arg CreateUserPayloadGetRolesAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateUserPayloadGetRolesAttributeType(arg *CreateUserPayloadGetRolesAttributeType, val CreateUserPayloadGetRolesRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setCreateUserPayloadGetRolesAttributeType(arg *CreateUserPayloadGetRolesAtt */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateUserPayloadGetUsernameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateUserPayloadGetUsernameAttributeTypeOk(arg CreateUserPayloadGetUsernameAttributeType) (ret CreateUserPayloadGetUsernameRetType, ok bool) { if arg == nil { return ret, false @@ -51,14 +61,19 @@ func getCreateUserPayloadGetUsernameAttributeTypeOk(arg CreateUserPayloadGetUser return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateUserPayloadGetUsernameAttributeType(arg *CreateUserPayloadGetUsernameAttributeType, val CreateUserPayloadGetUsernameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateUserPayloadGetUsernameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateUserPayloadGetUsernameRetType = string // CreateUserPayload struct for CreateUserPayload +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateUserPayload struct { Roles CreateUserPayloadGetRolesAttributeType `json:"roles,omitempty"` Username CreateUserPayloadGetUsernameAttributeType `json:"username,omitempty"` @@ -68,6 +83,7 @@ type CreateUserPayload 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 NewCreateUserPayload() *CreateUserPayload { this := CreateUserPayload{} return &this @@ -76,12 +92,14 @@ func NewCreateUserPayload() *CreateUserPayload { // NewCreateUserPayloadWithDefaults instantiates a new CreateUserPayload object // This 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 NewCreateUserPayloadWithDefaults() *CreateUserPayload { this := CreateUserPayload{} return &this } // GetRoles returns the Roles field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateUserPayload) GetRoles() (res CreateUserPayloadGetRolesRetType) { res, _ = o.GetRolesOk() return @@ -89,22 +107,26 @@ func (o *CreateUserPayload) GetRoles() (res CreateUserPayloadGetRolesRetType) { // GetRolesOk returns a tuple with the Roles field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateUserPayload) GetRolesOk() (ret CreateUserPayloadGetRolesRetType, ok bool) { return getCreateUserPayloadGetRolesAttributeTypeOk(o.Roles) } // HasRoles returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateUserPayload) HasRoles() bool { _, ok := o.GetRolesOk() return ok } // SetRoles gets a reference to the given []string and assigns it to the Roles field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateUserPayload) SetRoles(v CreateUserPayloadGetRolesRetType) { setCreateUserPayloadGetRolesAttributeType(&o.Roles, v) } // GetUsername returns the Username field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateUserPayload) GetUsername() (res CreateUserPayloadGetUsernameRetType) { res, _ = o.GetUsernameOk() return @@ -112,21 +134,25 @@ func (o *CreateUserPayload) GetUsername() (res CreateUserPayloadGetUsernameRetTy // GetUsernameOk returns a tuple with the Username field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateUserPayload) GetUsernameOk() (ret CreateUserPayloadGetUsernameRetType, ok bool) { return getCreateUserPayloadGetUsernameAttributeTypeOk(o.Username) } // HasUsername returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateUserPayload) HasUsername() bool { _, ok := o.GetUsernameOk() return ok } // SetUsername gets a reference to the given string and assigns it to the Username field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateUserPayload) SetUsername(v CreateUserPayloadGetUsernameRetType) { setCreateUserPayloadGetUsernameAttributeType(&o.Username, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateUserPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateUserPayloadGetRolesAttributeTypeOk(o.Roles); ok { @@ -138,37 +164,45 @@ func (o CreateUserPayload) 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 NullableCreateUserPayload struct { value *CreateUserPayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateUserPayload) Get() *CreateUserPayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateUserPayload) Set(val *CreateUserPayload) { 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 NullableCreateUserPayload) 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 *NullableCreateUserPayload) 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 NewNullableCreateUserPayload(val *CreateUserPayload) *NullableCreateUserPayload { return &NullableCreateUserPayload{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 NullableCreateUserPayload) 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 *NullableCreateUserPayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_create_user_response.go b/services/postgresflex/model_create_user_response.go index 6ebc16caf..b6483e0ff 100644 --- a/services/postgresflex/model_create_user_response.go +++ b/services/postgresflex/model_create_user_response.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &CreateUserResponse{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateUserResponseGetItemAttributeType = *User + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateUserResponseGetItemArgType = User + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateUserResponseGetItemRetType = User +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateUserResponseGetItemAttributeTypeOk(arg CreateUserResponseGetItemAttributeType) (ret CreateUserResponseGetItemRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getCreateUserResponseGetItemAttributeTypeOk(arg CreateUserResponseGetItemAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateUserResponseGetItemAttributeType(arg *CreateUserResponseGetItemAttributeType, val CreateUserResponseGetItemRetType) { *arg = &val } // CreateUserResponse struct for CreateUserResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateUserResponse struct { Item CreateUserResponseGetItemAttributeType `json:"item,omitempty"` } @@ -46,6 +55,7 @@ type CreateUserResponse 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 NewCreateUserResponse() *CreateUserResponse { this := CreateUserResponse{} return &this @@ -54,12 +64,14 @@ func NewCreateUserResponse() *CreateUserResponse { // NewCreateUserResponseWithDefaults instantiates a new CreateUserResponse object // This 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 NewCreateUserResponseWithDefaults() *CreateUserResponse { this := CreateUserResponse{} return &this } // GetItem returns the Item field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateUserResponse) GetItem() (res CreateUserResponseGetItemRetType) { res, _ = o.GetItemOk() return @@ -67,21 +79,25 @@ func (o *CreateUserResponse) GetItem() (res CreateUserResponseGetItemRetType) { // GetItemOk returns a tuple with the Item field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateUserResponse) GetItemOk() (ret CreateUserResponseGetItemRetType, ok bool) { return getCreateUserResponseGetItemAttributeTypeOk(o.Item) } // HasItem returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateUserResponse) HasItem() bool { _, ok := o.GetItemOk() return ok } // SetItem gets a reference to the given User and assigns it to the Item field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateUserResponse) SetItem(v CreateUserResponseGetItemRetType) { setCreateUserResponseGetItemAttributeType(&o.Item, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateUserResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateUserResponseGetItemAttributeTypeOk(o.Item); ok { @@ -90,37 +106,45 @@ func (o CreateUserResponse) 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 NullableCreateUserResponse struct { value *CreateUserResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateUserResponse) Get() *CreateUserResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateUserResponse) Set(val *CreateUserResponse) { 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 NullableCreateUserResponse) 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 *NullableCreateUserResponse) 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 NewNullableCreateUserResponse(val *CreateUserResponse) *NullableCreateUserResponse { return &NullableCreateUserResponse{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 NullableCreateUserResponse) 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 *NullableCreateUserResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_error.go b/services/postgresflex/model_error.go index bb495a843..5ced0f96c 100644 --- a/services/postgresflex/model_error.go +++ b/services/postgresflex/model_error.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &Error{} */ // isInteger +// 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,10 +50,16 @@ func setErrorGetCodeAttributeType(arg *ErrorGetCodeAttributeType, val ErrorGetCo */ // isContainer +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorGetFieldsAttributeType = *map[string][]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorGetFieldsArgType = map[string][]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorGetFieldsRetType = map[string][]string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getErrorGetFieldsAttributeTypeOk(arg ErrorGetFieldsAttributeType) (ret ErrorGetFieldsRetType, ok bool) { if arg == nil { return ret, false @@ -53,6 +67,7 @@ func getErrorGetFieldsAttributeTypeOk(arg ErrorGetFieldsAttributeType) (ret Erro return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setErrorGetFieldsAttributeType(arg *ErrorGetFieldsAttributeType, val ErrorGetFieldsRetType) { *arg = &val } @@ -62,8 +77,10 @@ func setErrorGetFieldsAttributeType(arg *ErrorGetFieldsAttributeType, val ErrorG */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorGetMessageAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getErrorGetMessageAttributeTypeOk(arg ErrorGetMessageAttributeType) (ret ErrorGetMessageRetType, ok bool) { if arg == nil { return ret, false @@ -71,11 +88,15 @@ func getErrorGetMessageAttributeTypeOk(arg ErrorGetMessageAttributeType) (ret Er return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setErrorGetMessageAttributeType(arg *ErrorGetMessageAttributeType, val ErrorGetMessageRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorGetMessageArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorGetMessageRetType = string /* @@ -83,8 +104,10 @@ type ErrorGetMessageRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorGetTypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getErrorGetTypeAttributeTypeOk(arg ErrorGetTypeAttributeType) (ret ErrorGetTypeRetType, ok bool) { if arg == nil { return ret, false @@ -92,14 +115,19 @@ func getErrorGetTypeAttributeTypeOk(arg ErrorGetTypeAttributeType) (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 setErrorGetTypeAttributeType(arg *ErrorGetTypeAttributeType, val ErrorGetTypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorGetTypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorGetTypeRetType = string // Error struct for Error +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Error struct { // Can be cast to int32 without loss of precision. Code ErrorGetCodeAttributeType `json:"code,omitempty"` @@ -112,6 +140,7 @@ type Error 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 NewError() *Error { this := Error{} return &this @@ -120,12 +149,14 @@ func NewError() *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 if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Error) GetCode() (res ErrorGetCodeRetType) { res, _ = o.GetCodeOk() return @@ -133,22 +164,26 @@ func (o *Error) GetCode() (res ErrorGetCodeRetType) { // GetCodeOk returns a tuple with the Code field value if set, nil otherwise // and a boolean to check if the value 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) } // HasCode returns a boolean if a field 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) HasCode() bool { _, ok := o.GetCodeOk() return ok } // SetCode gets a reference to the given int64 and assigns it to the Code field. +// 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) } // GetFields returns the Fields field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Error) GetFields() (res ErrorGetFieldsRetType) { res, _ = o.GetFieldsOk() return @@ -156,22 +191,26 @@ func (o *Error) GetFields() (res ErrorGetFieldsRetType) { // GetFieldsOk returns a tuple with the Fields field value if set, nil otherwise // and a boolean to check if the value 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) GetFieldsOk() (ret ErrorGetFieldsRetType, ok bool) { return getErrorGetFieldsAttributeTypeOk(o.Fields) } // HasFields returns a boolean if a field 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) HasFields() bool { _, ok := o.GetFieldsOk() return ok } // SetFields gets a reference to the given map[string][]string and assigns it to the Fields field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Error) SetFields(v ErrorGetFieldsRetType) { setErrorGetFieldsAttributeType(&o.Fields, v) } // GetMessage returns the Message field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Error) GetMessage() (res ErrorGetMessageRetType) { res, _ = o.GetMessageOk() return @@ -179,22 +218,26 @@ func (o *Error) GetMessage() (res ErrorGetMessageRetType) { // GetMessageOk returns a tuple with the Message field value if set, nil otherwise // and a boolean to check if the value 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) GetMessageOk() (ret ErrorGetMessageRetType, ok bool) { return getErrorGetMessageAttributeTypeOk(o.Message) } // HasMessage returns a boolean if a field 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) HasMessage() bool { _, ok := o.GetMessageOk() return ok } // SetMessage gets a reference to the given string and assigns it to the Message field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Error) SetMessage(v ErrorGetMessageRetType) { setErrorGetMessageAttributeType(&o.Message, 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 *Error) GetType() (res ErrorGetTypeRetType) { res, _ = o.GetTypeOk() return @@ -202,21 +245,25 @@ func (o *Error) GetType() (res ErrorGetTypeRetType) { // 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 *Error) GetTypeOk() (ret ErrorGetTypeRetType, ok bool) { return getErrorGetTypeAttributeTypeOk(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 *Error) 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 *Error) SetType(v ErrorGetTypeRetType) { setErrorGetTypeAttributeType(&o.Type, 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 { @@ -234,37 +281,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/postgresflex/model_extensions_configuration.go b/services/postgresflex/model_extensions_configuration.go index bfc83e699..46789fceb 100644 --- a/services/postgresflex/model_extensions_configuration.go +++ b/services/postgresflex/model_extensions_configuration.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &ExtensionsConfiguration{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ExtensionsConfigurationGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getExtensionsConfigurationGetNameAttributeTypeOk(arg ExtensionsConfigurationGetNameAttributeType) (ret ExtensionsConfigurationGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getExtensionsConfigurationGetNameAttributeTypeOk(arg ExtensionsConfiguratio return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setExtensionsConfigurationGetNameAttributeType(arg *ExtensionsConfigurationGetNameAttributeType, val ExtensionsConfigurationGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ExtensionsConfigurationGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ExtensionsConfigurationGetNameRetType = string /* @@ -43,8 +50,10 @@ type ExtensionsConfigurationGetNameRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ExtensionsConfigurationGetSettingAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getExtensionsConfigurationGetSettingAttributeTypeOk(arg ExtensionsConfigurationGetSettingAttributeType) (ret ExtensionsConfigurationGetSettingRetType, ok bool) { if arg == nil { return ret, false @@ -52,14 +61,19 @@ func getExtensionsConfigurationGetSettingAttributeTypeOk(arg ExtensionsConfigura return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setExtensionsConfigurationGetSettingAttributeType(arg *ExtensionsConfigurationGetSettingAttributeType, val ExtensionsConfigurationGetSettingRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ExtensionsConfigurationGetSettingArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ExtensionsConfigurationGetSettingRetType = string // ExtensionsConfiguration struct for ExtensionsConfiguration +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ExtensionsConfiguration struct { Name ExtensionsConfigurationGetNameAttributeType `json:"name,omitempty"` Setting ExtensionsConfigurationGetSettingAttributeType `json:"setting,omitempty"` @@ -69,6 +83,7 @@ type ExtensionsConfiguration 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 NewExtensionsConfiguration() *ExtensionsConfiguration { this := ExtensionsConfiguration{} return &this @@ -77,12 +92,14 @@ func NewExtensionsConfiguration() *ExtensionsConfiguration { // NewExtensionsConfigurationWithDefaults instantiates a new ExtensionsConfiguration object // This 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 NewExtensionsConfigurationWithDefaults() *ExtensionsConfiguration { this := ExtensionsConfiguration{} 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 *ExtensionsConfiguration) GetName() (res ExtensionsConfigurationGetNameRetType) { res, _ = o.GetNameOk() return @@ -90,22 +107,26 @@ func (o *ExtensionsConfiguration) GetName() (res ExtensionsConfigurationGetNameR // 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 *ExtensionsConfiguration) GetNameOk() (ret ExtensionsConfigurationGetNameRetType, ok bool) { return getExtensionsConfigurationGetNameAttributeTypeOk(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 *ExtensionsConfiguration) 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 *ExtensionsConfiguration) SetName(v ExtensionsConfigurationGetNameRetType) { setExtensionsConfigurationGetNameAttributeType(&o.Name, v) } // GetSetting returns the Setting field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ExtensionsConfiguration) GetSetting() (res ExtensionsConfigurationGetSettingRetType) { res, _ = o.GetSettingOk() return @@ -113,21 +134,25 @@ func (o *ExtensionsConfiguration) GetSetting() (res ExtensionsConfigurationGetSe // GetSettingOk returns a tuple with the Setting field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ExtensionsConfiguration) GetSettingOk() (ret ExtensionsConfigurationGetSettingRetType, ok bool) { return getExtensionsConfigurationGetSettingAttributeTypeOk(o.Setting) } // HasSetting returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ExtensionsConfiguration) HasSetting() bool { _, ok := o.GetSettingOk() return ok } // SetSetting gets a reference to the given string and assigns it to the Setting field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ExtensionsConfiguration) SetSetting(v ExtensionsConfigurationGetSettingRetType) { setExtensionsConfigurationGetSettingAttributeType(&o.Setting, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ExtensionsConfiguration) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getExtensionsConfigurationGetNameAttributeTypeOk(o.Name); ok { @@ -139,37 +164,45 @@ func (o ExtensionsConfiguration) 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 NullableExtensionsConfiguration struct { value *ExtensionsConfiguration isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableExtensionsConfiguration) Get() *ExtensionsConfiguration { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableExtensionsConfiguration) Set(val *ExtensionsConfiguration) { 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 NullableExtensionsConfiguration) 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 *NullableExtensionsConfiguration) 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 NewNullableExtensionsConfiguration(val *ExtensionsConfiguration) *NullableExtensionsConfiguration { return &NullableExtensionsConfiguration{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 NullableExtensionsConfiguration) 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 *NullableExtensionsConfiguration) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_extensions_extension_list_response.go b/services/postgresflex/model_extensions_extension_list_response.go index 0d94be2c3..607481349 100644 --- a/services/postgresflex/model_extensions_extension_list_response.go +++ b/services/postgresflex/model_extensions_extension_list_response.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ExtensionsExtensionListResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ExtensionsExtensionListResponseGetListAttributeType = *[]ApiExtensionList + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ExtensionsExtensionListResponseGetListArgType = []ApiExtensionList + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ExtensionsExtensionListResponseGetListRetType = []ApiExtensionList +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getExtensionsExtensionListResponseGetListAttributeTypeOk(arg ExtensionsExtensionListResponseGetListAttributeType) (ret ExtensionsExtensionListResponseGetListRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getExtensionsExtensionListResponseGetListAttributeTypeOk(arg ExtensionsExte return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setExtensionsExtensionListResponseGetListAttributeType(arg *ExtensionsExtensionListResponseGetListAttributeType, val ExtensionsExtensionListResponseGetListRetType) { *arg = &val } // ExtensionsExtensionListResponse struct for ExtensionsExtensionListResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ExtensionsExtensionListResponse struct { List ExtensionsExtensionListResponseGetListAttributeType `json:"list,omitempty"` } @@ -46,6 +55,7 @@ type ExtensionsExtensionListResponse 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 NewExtensionsExtensionListResponse() *ExtensionsExtensionListResponse { this := ExtensionsExtensionListResponse{} return &this @@ -54,12 +64,14 @@ func NewExtensionsExtensionListResponse() *ExtensionsExtensionListResponse { // NewExtensionsExtensionListResponseWithDefaults instantiates a new ExtensionsExtensionListResponse object // This 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 NewExtensionsExtensionListResponseWithDefaults() *ExtensionsExtensionListResponse { this := ExtensionsExtensionListResponse{} return &this } // GetList returns the List field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ExtensionsExtensionListResponse) GetList() (res ExtensionsExtensionListResponseGetListRetType) { res, _ = o.GetListOk() return @@ -67,21 +79,25 @@ func (o *ExtensionsExtensionListResponse) GetList() (res ExtensionsExtensionList // GetListOk returns a tuple with the List field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ExtensionsExtensionListResponse) GetListOk() (ret ExtensionsExtensionListResponseGetListRetType, ok bool) { return getExtensionsExtensionListResponseGetListAttributeTypeOk(o.List) } // HasList returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ExtensionsExtensionListResponse) HasList() bool { _, ok := o.GetListOk() return ok } // SetList gets a reference to the given []ApiExtensionList and assigns it to the List field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ExtensionsExtensionListResponse) SetList(v ExtensionsExtensionListResponseGetListRetType) { setExtensionsExtensionListResponseGetListAttributeType(&o.List, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ExtensionsExtensionListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getExtensionsExtensionListResponseGetListAttributeTypeOk(o.List); ok { @@ -90,37 +106,45 @@ func (o ExtensionsExtensionListResponse) 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 NullableExtensionsExtensionListResponse struct { value *ExtensionsExtensionListResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableExtensionsExtensionListResponse) Get() *ExtensionsExtensionListResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableExtensionsExtensionListResponse) Set(val *ExtensionsExtensionListResponse) { 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 NullableExtensionsExtensionListResponse) 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 *NullableExtensionsExtensionListResponse) 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 NewNullableExtensionsExtensionListResponse(val *ExtensionsExtensionListResponse) *NullableExtensionsExtensionListResponse { return &NullableExtensionsExtensionListResponse{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 NullableExtensionsExtensionListResponse) 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 *NullableExtensionsExtensionListResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_extensions_new_config.go b/services/postgresflex/model_extensions_new_config.go index 0f400ef5c..42fadb517 100644 --- a/services/postgresflex/model_extensions_new_config.go +++ b/services/postgresflex/model_extensions_new_config.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ExtensionsNewConfig{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ExtensionsNewConfigGetConfigurationAttributeType = *[]ExtensionsConfiguration + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ExtensionsNewConfigGetConfigurationArgType = []ExtensionsConfiguration + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ExtensionsNewConfigGetConfigurationRetType = []ExtensionsConfiguration +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getExtensionsNewConfigGetConfigurationAttributeTypeOk(arg ExtensionsNewConfigGetConfigurationAttributeType) (ret ExtensionsNewConfigGetConfigurationRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getExtensionsNewConfigGetConfigurationAttributeTypeOk(arg ExtensionsNewConf return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setExtensionsNewConfigGetConfigurationAttributeType(arg *ExtensionsNewConfigGetConfigurationAttributeType, val ExtensionsNewConfigGetConfigurationRetType) { *arg = &val } // ExtensionsNewConfig struct for ExtensionsNewConfig +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ExtensionsNewConfig struct { Configuration ExtensionsNewConfigGetConfigurationAttributeType `json:"configuration,omitempty"` } @@ -46,6 +55,7 @@ type ExtensionsNewConfig 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 NewExtensionsNewConfig() *ExtensionsNewConfig { this := ExtensionsNewConfig{} return &this @@ -54,12 +64,14 @@ func NewExtensionsNewConfig() *ExtensionsNewConfig { // NewExtensionsNewConfigWithDefaults instantiates a new ExtensionsNewConfig object // This 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 NewExtensionsNewConfigWithDefaults() *ExtensionsNewConfig { this := ExtensionsNewConfig{} return &this } // GetConfiguration returns the Configuration field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ExtensionsNewConfig) GetConfiguration() (res ExtensionsNewConfigGetConfigurationRetType) { res, _ = o.GetConfigurationOk() return @@ -67,21 +79,25 @@ func (o *ExtensionsNewConfig) GetConfiguration() (res ExtensionsNewConfigGetConf // GetConfigurationOk returns a tuple with the Configuration field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ExtensionsNewConfig) GetConfigurationOk() (ret ExtensionsNewConfigGetConfigurationRetType, ok bool) { return getExtensionsNewConfigGetConfigurationAttributeTypeOk(o.Configuration) } // HasConfiguration returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ExtensionsNewConfig) HasConfiguration() bool { _, ok := o.GetConfigurationOk() return ok } // SetConfiguration gets a reference to the given []ExtensionsConfiguration and assigns it to the Configuration field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ExtensionsNewConfig) SetConfiguration(v ExtensionsNewConfigGetConfigurationRetType) { setExtensionsNewConfigGetConfigurationAttributeType(&o.Configuration, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ExtensionsNewConfig) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getExtensionsNewConfigGetConfigurationAttributeTypeOk(o.Configuration); ok { @@ -90,37 +106,45 @@ func (o ExtensionsNewConfig) 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 NullableExtensionsNewConfig struct { value *ExtensionsNewConfig isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableExtensionsNewConfig) Get() *ExtensionsNewConfig { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableExtensionsNewConfig) Set(val *ExtensionsNewConfig) { 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 NullableExtensionsNewConfig) 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 *NullableExtensionsNewConfig) 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 NewNullableExtensionsNewConfig(val *ExtensionsNewConfig) *NullableExtensionsNewConfig { return &NullableExtensionsNewConfig{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 NullableExtensionsNewConfig) 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 *NullableExtensionsNewConfig) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_flavor.go b/services/postgresflex/model_flavor.go index fb7431a11..3205aae95 100644 --- a/services/postgresflex/model_flavor.go +++ b/services/postgresflex/model_flavor.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &Flavor{} */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type FlavorGetCpuAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type FlavorGetCpuArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type FlavorGetCpuRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getFlavorGetCpuAttributeTypeOk(arg FlavorGetCpuAttributeType) (ret FlavorGetCpuRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getFlavorGetCpuAttributeTypeOk(arg FlavorGetCpuAttributeType) (ret FlavorGe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setFlavorGetCpuAttributeType(arg *FlavorGetCpuAttributeType, val FlavorGetCpuRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setFlavorGetCpuAttributeType(arg *FlavorGetCpuAttributeType, val FlavorGetC */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type FlavorGetDescriptionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getFlavorGetDescriptionAttributeTypeOk(arg FlavorGetDescriptionAttributeType) (ret FlavorGetDescriptionRetType, ok bool) { if arg == nil { return ret, false @@ -51,11 +61,15 @@ func getFlavorGetDescriptionAttributeTypeOk(arg FlavorGetDescriptionAttributeTyp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setFlavorGetDescriptionAttributeType(arg *FlavorGetDescriptionAttributeType, val FlavorGetDescriptionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type FlavorGetDescriptionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type FlavorGetDescriptionRetType = string /* @@ -63,8 +77,10 @@ type FlavorGetDescriptionRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type FlavorGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getFlavorGetIdAttributeTypeOk(arg FlavorGetIdAttributeType) (ret FlavorGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -72,11 +88,15 @@ func getFlavorGetIdAttributeTypeOk(arg FlavorGetIdAttributeType) (ret FlavorGetI return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setFlavorGetIdAttributeType(arg *FlavorGetIdAttributeType, val FlavorGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type FlavorGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type FlavorGetIdRetType = string /* @@ -84,10 +104,16 @@ type FlavorGetIdRetType = string */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type FlavorGetMemoryAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type FlavorGetMemoryArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type FlavorGetMemoryRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getFlavorGetMemoryAttributeTypeOk(arg FlavorGetMemoryAttributeType) (ret FlavorGetMemoryRetType, ok bool) { if arg == nil { return ret, false @@ -95,11 +121,13 @@ func getFlavorGetMemoryAttributeTypeOk(arg FlavorGetMemoryAttributeType) (ret Fl return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setFlavorGetMemoryAttributeType(arg *FlavorGetMemoryAttributeType, val FlavorGetMemoryRetType) { *arg = &val } // Flavor struct for Flavor +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Flavor struct { Cpu FlavorGetCpuAttributeType `json:"cpu,omitempty"` Description FlavorGetDescriptionAttributeType `json:"description,omitempty"` @@ -111,6 +139,7 @@ type Flavor 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 NewFlavor() *Flavor { this := Flavor{} return &this @@ -119,12 +148,14 @@ func NewFlavor() *Flavor { // NewFlavorWithDefaults instantiates a new Flavor object // This 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 NewFlavorWithDefaults() *Flavor { this := Flavor{} return &this } // GetCpu returns the Cpu field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Flavor) GetCpu() (res FlavorGetCpuRetType) { res, _ = o.GetCpuOk() return @@ -132,22 +163,26 @@ func (o *Flavor) GetCpu() (res FlavorGetCpuRetType) { // GetCpuOk returns a tuple with the Cpu field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Flavor) GetCpuOk() (ret FlavorGetCpuRetType, ok bool) { return getFlavorGetCpuAttributeTypeOk(o.Cpu) } // HasCpu returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Flavor) HasCpu() bool { _, ok := o.GetCpuOk() return ok } // SetCpu gets a reference to the given int64 and assigns it to the Cpu field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Flavor) SetCpu(v FlavorGetCpuRetType) { setFlavorGetCpuAttributeType(&o.Cpu, 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 *Flavor) GetDescription() (res FlavorGetDescriptionRetType) { res, _ = o.GetDescriptionOk() return @@ -155,22 +190,26 @@ func (o *Flavor) GetDescription() (res FlavorGetDescriptionRetType) { // 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 *Flavor) GetDescriptionOk() (ret FlavorGetDescriptionRetType, ok bool) { return getFlavorGetDescriptionAttributeTypeOk(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 *Flavor) 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 *Flavor) SetDescription(v FlavorGetDescriptionRetType) { setFlavorGetDescriptionAttributeType(&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 *Flavor) GetId() (res FlavorGetIdRetType) { res, _ = o.GetIdOk() return @@ -178,22 +217,26 @@ func (o *Flavor) GetId() (res FlavorGetIdRetType) { // 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 *Flavor) GetIdOk() (ret FlavorGetIdRetType, ok bool) { return getFlavorGetIdAttributeTypeOk(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 *Flavor) 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 *Flavor) SetId(v FlavorGetIdRetType) { setFlavorGetIdAttributeType(&o.Id, v) } // GetMemory returns the Memory field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Flavor) GetMemory() (res FlavorGetMemoryRetType) { res, _ = o.GetMemoryOk() return @@ -201,21 +244,25 @@ func (o *Flavor) GetMemory() (res FlavorGetMemoryRetType) { // GetMemoryOk returns a tuple with the Memory field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Flavor) GetMemoryOk() (ret FlavorGetMemoryRetType, ok bool) { return getFlavorGetMemoryAttributeTypeOk(o.Memory) } // HasMemory returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Flavor) HasMemory() bool { _, ok := o.GetMemoryOk() return ok } // SetMemory gets a reference to the given int64 and assigns it to the Memory field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Flavor) SetMemory(v FlavorGetMemoryRetType) { setFlavorGetMemoryAttributeType(&o.Memory, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o Flavor) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getFlavorGetCpuAttributeTypeOk(o.Cpu); ok { @@ -233,37 +280,45 @@ func (o Flavor) 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 NullableFlavor struct { value *Flavor isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableFlavor) Get() *Flavor { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableFlavor) Set(val *Flavor) { 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 NullableFlavor) 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 *NullableFlavor) 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 NewNullableFlavor(val *Flavor) *NullableFlavor { return &NullableFlavor{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 NullableFlavor) 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 *NullableFlavor) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_get_backup_response.go b/services/postgresflex/model_get_backup_response.go index 417e7c0b6..2c5751b0c 100644 --- a/services/postgresflex/model_get_backup_response.go +++ b/services/postgresflex/model_get_backup_response.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &GetBackupResponse{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupResponseGetItemAttributeType = *Backup + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupResponseGetItemArgType = Backup + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupResponseGetItemRetType = Backup +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetBackupResponseGetItemAttributeTypeOk(arg GetBackupResponseGetItemAttributeType) (ret GetBackupResponseGetItemRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getGetBackupResponseGetItemAttributeTypeOk(arg GetBackupResponseGetItemAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetBackupResponseGetItemAttributeType(arg *GetBackupResponseGetItemAttributeType, val GetBackupResponseGetItemRetType) { *arg = &val } // GetBackupResponse struct for GetBackupResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupResponse struct { Item GetBackupResponseGetItemAttributeType `json:"item,omitempty"` } @@ -46,6 +55,7 @@ type GetBackupResponse 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 NewGetBackupResponse() *GetBackupResponse { this := GetBackupResponse{} return &this @@ -54,12 +64,14 @@ func NewGetBackupResponse() *GetBackupResponse { // NewGetBackupResponseWithDefaults instantiates a new GetBackupResponse object // This 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 NewGetBackupResponseWithDefaults() *GetBackupResponse { this := GetBackupResponse{} return &this } // GetItem returns the Item field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetBackupResponse) GetItem() (res GetBackupResponseGetItemRetType) { res, _ = o.GetItemOk() return @@ -67,21 +79,25 @@ func (o *GetBackupResponse) GetItem() (res GetBackupResponseGetItemRetType) { // GetItemOk returns a tuple with the Item field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetBackupResponse) GetItemOk() (ret GetBackupResponseGetItemRetType, ok bool) { return getGetBackupResponseGetItemAttributeTypeOk(o.Item) } // HasItem returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetBackupResponse) HasItem() bool { _, ok := o.GetItemOk() return ok } // SetItem gets a reference to the given Backup and assigns it to the Item field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetBackupResponse) SetItem(v GetBackupResponseGetItemRetType) { setGetBackupResponseGetItemAttributeType(&o.Item, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o GetBackupResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getGetBackupResponseGetItemAttributeTypeOk(o.Item); ok { @@ -90,37 +106,45 @@ func (o GetBackupResponse) 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 NullableGetBackupResponse struct { value *GetBackupResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetBackupResponse) Get() *GetBackupResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetBackupResponse) Set(val *GetBackupResponse) { 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 NullableGetBackupResponse) 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 *NullableGetBackupResponse) 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 NewNullableGetBackupResponse(val *GetBackupResponse) *NullableGetBackupResponse { return &NullableGetBackupResponse{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 NullableGetBackupResponse) 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 *NullableGetBackupResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_get_user_response.go b/services/postgresflex/model_get_user_response.go index 9e5070c8f..19db657d0 100644 --- a/services/postgresflex/model_get_user_response.go +++ b/services/postgresflex/model_get_user_response.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &GetUserResponse{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetUserResponseGetItemAttributeType = *UserResponse + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetUserResponseGetItemArgType = UserResponse + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetUserResponseGetItemRetType = UserResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetUserResponseGetItemAttributeTypeOk(arg GetUserResponseGetItemAttributeType) (ret GetUserResponseGetItemRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getGetUserResponseGetItemAttributeTypeOk(arg GetUserResponseGetItemAttribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetUserResponseGetItemAttributeType(arg *GetUserResponseGetItemAttributeType, val GetUserResponseGetItemRetType) { *arg = &val } // GetUserResponse struct for GetUserResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetUserResponse struct { Item GetUserResponseGetItemAttributeType `json:"item,omitempty"` } @@ -46,6 +55,7 @@ type GetUserResponse 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 NewGetUserResponse() *GetUserResponse { this := GetUserResponse{} return &this @@ -54,12 +64,14 @@ func NewGetUserResponse() *GetUserResponse { // NewGetUserResponseWithDefaults instantiates a new GetUserResponse object // This 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 NewGetUserResponseWithDefaults() *GetUserResponse { this := GetUserResponse{} return &this } // GetItem returns the Item field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetUserResponse) GetItem() (res GetUserResponseGetItemRetType) { res, _ = o.GetItemOk() return @@ -67,21 +79,25 @@ func (o *GetUserResponse) GetItem() (res GetUserResponseGetItemRetType) { // GetItemOk returns a tuple with the Item field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetUserResponse) GetItemOk() (ret GetUserResponseGetItemRetType, ok bool) { return getGetUserResponseGetItemAttributeTypeOk(o.Item) } // HasItem returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetUserResponse) HasItem() bool { _, ok := o.GetItemOk() return ok } // SetItem gets a reference to the given UserResponse and assigns it to the Item field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetUserResponse) SetItem(v GetUserResponseGetItemRetType) { setGetUserResponseGetItemAttributeType(&o.Item, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o GetUserResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getGetUserResponseGetItemAttributeTypeOk(o.Item); ok { @@ -90,37 +106,45 @@ func (o GetUserResponse) 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 NullableGetUserResponse struct { value *GetUserResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetUserResponse) Get() *GetUserResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetUserResponse) Set(val *GetUserResponse) { 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 NullableGetUserResponse) 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 *NullableGetUserResponse) 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 NewNullableGetUserResponse(val *GetUserResponse) *NullableGetUserResponse { return &NullableGetUserResponse{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 NullableGetUserResponse) 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 *NullableGetUserResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_instance.go b/services/postgresflex/model_instance.go index 39f6fc57c..a1ceddbfe 100644 --- a/services/postgresflex/model_instance.go +++ b/services/postgresflex/model_instance.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &Instance{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetAclAttributeType = *ACL + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetAclArgType = ACL + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetAclRetType = ACL +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceGetAclAttributeTypeOk(arg InstanceGetAclAttributeType) (ret InstanceGetAclRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getInstanceGetAclAttributeTypeOk(arg InstanceGetAclAttributeType) (ret Inst return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceGetAclAttributeType(arg *InstanceGetAclAttributeType, val InstanceGetAclRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setInstanceGetAclAttributeType(arg *InstanceGetAclAttributeType, val Instan */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetBackupScheduleAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceGetBackupScheduleAttributeTypeOk(arg InstanceGetBackupScheduleAttributeType) (ret InstanceGetBackupScheduleRetType, ok bool) { if arg == nil { return ret, false @@ -51,11 +61,15 @@ func getInstanceGetBackupScheduleAttributeTypeOk(arg InstanceGetBackupScheduleAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceGetBackupScheduleAttributeType(arg *InstanceGetBackupScheduleAttributeType, val InstanceGetBackupScheduleRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetBackupScheduleArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetBackupScheduleRetType = string /* @@ -63,10 +77,16 @@ type InstanceGetBackupScheduleRetType = string */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetFlavorAttributeType = *Flavor + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetFlavorArgType = Flavor + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetFlavorRetType = Flavor +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceGetFlavorAttributeTypeOk(arg InstanceGetFlavorAttributeType) (ret InstanceGetFlavorRetType, ok bool) { if arg == nil { return ret, false @@ -74,6 +94,7 @@ func getInstanceGetFlavorAttributeTypeOk(arg InstanceGetFlavorAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceGetFlavorAttributeType(arg *InstanceGetFlavorAttributeType, val InstanceGetFlavorRetType) { *arg = &val } @@ -83,8 +104,10 @@ func setInstanceGetFlavorAttributeType(arg *InstanceGetFlavorAttributeType, val */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceGetIdAttributeTypeOk(arg InstanceGetIdAttributeType) (ret InstanceGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -92,11 +115,15 @@ func getInstanceGetIdAttributeTypeOk(arg InstanceGetIdAttributeType) (ret Instan return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceGetIdAttributeType(arg *InstanceGetIdAttributeType, val InstanceGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetIdRetType = string /* @@ -104,8 +131,10 @@ type InstanceGetIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceGetNameAttributeTypeOk(arg InstanceGetNameAttributeType) (ret InstanceGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -113,11 +142,15 @@ func getInstanceGetNameAttributeTypeOk(arg InstanceGetNameAttributeType) (ret In return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceGetNameAttributeType(arg *InstanceGetNameAttributeType, val InstanceGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetNameRetType = string /* @@ -125,10 +158,16 @@ type InstanceGetNameRetType = string */ // isContainer +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetOptionsAttributeType = *map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetOptionsArgType = map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetOptionsRetType = map[string]string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceGetOptionsAttributeTypeOk(arg InstanceGetOptionsAttributeType) (ret InstanceGetOptionsRetType, ok bool) { if arg == nil { return ret, false @@ -136,6 +175,7 @@ func getInstanceGetOptionsAttributeTypeOk(arg InstanceGetOptionsAttributeType) ( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceGetOptionsAttributeType(arg *InstanceGetOptionsAttributeType, val InstanceGetOptionsRetType) { *arg = &val } @@ -145,10 +185,16 @@ func setInstanceGetOptionsAttributeType(arg *InstanceGetOptionsAttributeType, va */ // isInteger +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetReplicasAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetReplicasArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetReplicasRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceGetReplicasAttributeTypeOk(arg InstanceGetReplicasAttributeType) (ret InstanceGetReplicasRetType, ok bool) { if arg == nil { return ret, false @@ -156,6 +202,7 @@ func getInstanceGetReplicasAttributeTypeOk(arg InstanceGetReplicasAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceGetReplicasAttributeType(arg *InstanceGetReplicasAttributeType, val InstanceGetReplicasRetType) { *arg = &val } @@ -165,8 +212,10 @@ func setInstanceGetReplicasAttributeType(arg *InstanceGetReplicasAttributeType, */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetStatusAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceGetStatusAttributeTypeOk(arg InstanceGetStatusAttributeType) (ret InstanceGetStatusRetType, ok bool) { if arg == nil { return ret, false @@ -174,11 +223,15 @@ func getInstanceGetStatusAttributeTypeOk(arg InstanceGetStatusAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceGetStatusAttributeType(arg *InstanceGetStatusAttributeType, val InstanceGetStatusRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetStatusArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetStatusRetType = string /* @@ -186,10 +239,16 @@ type InstanceGetStatusRetType = string */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetStorageAttributeType = *Storage + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetStorageArgType = Storage + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetStorageRetType = Storage +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceGetStorageAttributeTypeOk(arg InstanceGetStorageAttributeType) (ret InstanceGetStorageRetType, ok bool) { if arg == nil { return ret, false @@ -197,6 +256,7 @@ func getInstanceGetStorageAttributeTypeOk(arg InstanceGetStorageAttributeType) ( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceGetStorageAttributeType(arg *InstanceGetStorageAttributeType, val InstanceGetStorageRetType) { *arg = &val } @@ -206,8 +266,10 @@ func setInstanceGetStorageAttributeType(arg *InstanceGetStorageAttributeType, va */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetVersionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceGetVersionAttributeTypeOk(arg InstanceGetVersionAttributeType) (ret InstanceGetVersionRetType, ok bool) { if arg == nil { return ret, false @@ -215,14 +277,19 @@ func getInstanceGetVersionAttributeTypeOk(arg InstanceGetVersionAttributeType) ( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceGetVersionAttributeType(arg *InstanceGetVersionAttributeType, val InstanceGetVersionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetVersionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetVersionRetType = string // Instance struct for Instance +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Instance struct { Acl InstanceGetAclAttributeType `json:"acl,omitempty"` BackupSchedule InstanceGetBackupScheduleAttributeType `json:"backupSchedule,omitempty"` @@ -241,6 +308,7 @@ type Instance 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 NewInstance() *Instance { this := Instance{} return &this @@ -249,12 +317,14 @@ func NewInstance() *Instance { // NewInstanceWithDefaults instantiates a new Instance object // This 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 NewInstanceWithDefaults() *Instance { this := Instance{} return &this } // GetAcl returns the Acl field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) GetAcl() (res InstanceGetAclRetType) { res, _ = o.GetAclOk() return @@ -262,22 +332,26 @@ func (o *Instance) GetAcl() (res InstanceGetAclRetType) { // GetAclOk returns a tuple with the Acl field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) GetAclOk() (ret InstanceGetAclRetType, ok bool) { return getInstanceGetAclAttributeTypeOk(o.Acl) } // HasAcl returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) HasAcl() bool { _, ok := o.GetAclOk() return ok } // SetAcl gets a reference to the given ACL and assigns it to the Acl field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) SetAcl(v InstanceGetAclRetType) { setInstanceGetAclAttributeType(&o.Acl, v) } // GetBackupSchedule returns the BackupSchedule field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) GetBackupSchedule() (res InstanceGetBackupScheduleRetType) { res, _ = o.GetBackupScheduleOk() return @@ -285,22 +359,26 @@ func (o *Instance) GetBackupSchedule() (res InstanceGetBackupScheduleRetType) { // GetBackupScheduleOk returns a tuple with the BackupSchedule field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) GetBackupScheduleOk() (ret InstanceGetBackupScheduleRetType, ok bool) { return getInstanceGetBackupScheduleAttributeTypeOk(o.BackupSchedule) } // HasBackupSchedule returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) HasBackupSchedule() bool { _, ok := o.GetBackupScheduleOk() return ok } // SetBackupSchedule gets a reference to the given string and assigns it to the BackupSchedule field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) SetBackupSchedule(v InstanceGetBackupScheduleRetType) { setInstanceGetBackupScheduleAttributeType(&o.BackupSchedule, v) } // GetFlavor returns the Flavor field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) GetFlavor() (res InstanceGetFlavorRetType) { res, _ = o.GetFlavorOk() return @@ -308,22 +386,26 @@ func (o *Instance) GetFlavor() (res InstanceGetFlavorRetType) { // GetFlavorOk returns a tuple with the Flavor field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) GetFlavorOk() (ret InstanceGetFlavorRetType, ok bool) { return getInstanceGetFlavorAttributeTypeOk(o.Flavor) } // HasFlavor returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) HasFlavor() bool { _, ok := o.GetFlavorOk() return ok } // SetFlavor gets a reference to the given Flavor and assigns it to the Flavor field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) SetFlavor(v InstanceGetFlavorRetType) { setInstanceGetFlavorAttributeType(&o.Flavor, 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 *Instance) GetId() (res InstanceGetIdRetType) { res, _ = o.GetIdOk() return @@ -331,22 +413,26 @@ func (o *Instance) GetId() (res InstanceGetIdRetType) { // 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 *Instance) GetIdOk() (ret InstanceGetIdRetType, ok bool) { return getInstanceGetIdAttributeTypeOk(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 *Instance) 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 *Instance) SetId(v InstanceGetIdRetType) { setInstanceGetIdAttributeType(&o.Id, 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 *Instance) GetName() (res InstanceGetNameRetType) { res, _ = o.GetNameOk() return @@ -354,22 +440,26 @@ func (o *Instance) GetName() (res InstanceGetNameRetType) { // 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 *Instance) GetNameOk() (ret InstanceGetNameRetType, ok bool) { return getInstanceGetNameAttributeTypeOk(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 *Instance) 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 *Instance) SetName(v InstanceGetNameRetType) { setInstanceGetNameAttributeType(&o.Name, v) } // GetOptions returns the Options field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) GetOptions() (res InstanceGetOptionsRetType) { res, _ = o.GetOptionsOk() return @@ -377,22 +467,26 @@ func (o *Instance) GetOptions() (res InstanceGetOptionsRetType) { // GetOptionsOk returns a tuple with the Options field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) GetOptionsOk() (ret InstanceGetOptionsRetType, ok bool) { return getInstanceGetOptionsAttributeTypeOk(o.Options) } // HasOptions returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) HasOptions() bool { _, ok := o.GetOptionsOk() return ok } // SetOptions gets a reference to the given map[string]string and assigns it to the Options field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) SetOptions(v InstanceGetOptionsRetType) { setInstanceGetOptionsAttributeType(&o.Options, v) } // GetReplicas returns the Replicas field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) GetReplicas() (res InstanceGetReplicasRetType) { res, _ = o.GetReplicasOk() return @@ -400,22 +494,26 @@ func (o *Instance) GetReplicas() (res InstanceGetReplicasRetType) { // GetReplicasOk returns a tuple with the Replicas field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) GetReplicasOk() (ret InstanceGetReplicasRetType, ok bool) { return getInstanceGetReplicasAttributeTypeOk(o.Replicas) } // HasReplicas returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) HasReplicas() bool { _, ok := o.GetReplicasOk() return ok } // SetReplicas gets a reference to the given int64 and assigns it to the Replicas field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) SetReplicas(v InstanceGetReplicasRetType) { setInstanceGetReplicasAttributeType(&o.Replicas, 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 *Instance) GetStatus() (res InstanceGetStatusRetType) { res, _ = o.GetStatusOk() return @@ -423,22 +521,26 @@ func (o *Instance) GetStatus() (res InstanceGetStatusRetType) { // 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 *Instance) GetStatusOk() (ret InstanceGetStatusRetType, ok bool) { return getInstanceGetStatusAttributeTypeOk(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 *Instance) 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 *Instance) SetStatus(v InstanceGetStatusRetType) { setInstanceGetStatusAttributeType(&o.Status, v) } // GetStorage returns the Storage field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) GetStorage() (res InstanceGetStorageRetType) { res, _ = o.GetStorageOk() return @@ -446,22 +548,26 @@ func (o *Instance) GetStorage() (res InstanceGetStorageRetType) { // GetStorageOk returns a tuple with the Storage field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) GetStorageOk() (ret InstanceGetStorageRetType, ok bool) { return getInstanceGetStorageAttributeTypeOk(o.Storage) } // HasStorage returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) HasStorage() bool { _, ok := o.GetStorageOk() return ok } // SetStorage gets a reference to the given Storage and assigns it to the Storage field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) SetStorage(v InstanceGetStorageRetType) { setInstanceGetStorageAttributeType(&o.Storage, v) } // GetVersion returns the Version field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) GetVersion() (res InstanceGetVersionRetType) { res, _ = o.GetVersionOk() return @@ -469,21 +575,25 @@ func (o *Instance) GetVersion() (res InstanceGetVersionRetType) { // GetVersionOk returns a tuple with the Version field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) GetVersionOk() (ret InstanceGetVersionRetType, ok bool) { return getInstanceGetVersionAttributeTypeOk(o.Version) } // HasVersion returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) HasVersion() bool { _, ok := o.GetVersionOk() return ok } // SetVersion gets a reference to the given string and assigns it to the Version field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) SetVersion(v InstanceGetVersionRetType) { setInstanceGetVersionAttributeType(&o.Version, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o Instance) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getInstanceGetAclAttributeTypeOk(o.Acl); ok { @@ -519,37 +629,45 @@ func (o Instance) 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 NullableInstance struct { value *Instance isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInstance) Get() *Instance { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInstance) Set(val *Instance) { 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 NullableInstance) 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 *NullableInstance) 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 NewNullableInstance(val *Instance) *NullableInstance { return &NullableInstance{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 NullableInstance) 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 *NullableInstance) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_instance_create_database_response.go b/services/postgresflex/model_instance_create_database_response.go index ad5ed08f9..93b2bc650 100644 --- a/services/postgresflex/model_instance_create_database_response.go +++ b/services/postgresflex/model_instance_create_database_response.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &InstanceCreateDatabaseResponse{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceCreateDatabaseResponseGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceCreateDatabaseResponseGetIdAttributeTypeOk(arg InstanceCreateDatabaseResponseGetIdAttributeType) (ret InstanceCreateDatabaseResponseGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -31,14 +34,19 @@ func getInstanceCreateDatabaseResponseGetIdAttributeTypeOk(arg InstanceCreateDat return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceCreateDatabaseResponseGetIdAttributeType(arg *InstanceCreateDatabaseResponseGetIdAttributeType, val InstanceCreateDatabaseResponseGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceCreateDatabaseResponseGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceCreateDatabaseResponseGetIdRetType = string // InstanceCreateDatabaseResponse struct for InstanceCreateDatabaseResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceCreateDatabaseResponse struct { Id InstanceCreateDatabaseResponseGetIdAttributeType `json:"id,omitempty"` } @@ -47,6 +55,7 @@ type InstanceCreateDatabaseResponse 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 NewInstanceCreateDatabaseResponse() *InstanceCreateDatabaseResponse { this := InstanceCreateDatabaseResponse{} return &this @@ -55,12 +64,14 @@ func NewInstanceCreateDatabaseResponse() *InstanceCreateDatabaseResponse { // NewInstanceCreateDatabaseResponseWithDefaults instantiates a new InstanceCreateDatabaseResponse object // This 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 NewInstanceCreateDatabaseResponseWithDefaults() *InstanceCreateDatabaseResponse { this := InstanceCreateDatabaseResponse{} 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 *InstanceCreateDatabaseResponse) GetId() (res InstanceCreateDatabaseResponseGetIdRetType) { res, _ = o.GetIdOk() return @@ -68,21 +79,25 @@ func (o *InstanceCreateDatabaseResponse) GetId() (res InstanceCreateDatabaseResp // 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 *InstanceCreateDatabaseResponse) GetIdOk() (ret InstanceCreateDatabaseResponseGetIdRetType, ok bool) { return getInstanceCreateDatabaseResponseGetIdAttributeTypeOk(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 *InstanceCreateDatabaseResponse) 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 *InstanceCreateDatabaseResponse) SetId(v InstanceCreateDatabaseResponseGetIdRetType) { setInstanceCreateDatabaseResponseGetIdAttributeType(&o.Id, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o InstanceCreateDatabaseResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getInstanceCreateDatabaseResponseGetIdAttributeTypeOk(o.Id); ok { @@ -91,37 +106,45 @@ func (o InstanceCreateDatabaseResponse) 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 NullableInstanceCreateDatabaseResponse struct { value *InstanceCreateDatabaseResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInstanceCreateDatabaseResponse) Get() *InstanceCreateDatabaseResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInstanceCreateDatabaseResponse) Set(val *InstanceCreateDatabaseResponse) { 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 NullableInstanceCreateDatabaseResponse) 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 *NullableInstanceCreateDatabaseResponse) 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 NewNullableInstanceCreateDatabaseResponse(val *InstanceCreateDatabaseResponse) *NullableInstanceCreateDatabaseResponse { return &NullableInstanceCreateDatabaseResponse{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 NullableInstanceCreateDatabaseResponse) 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 *NullableInstanceCreateDatabaseResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_instance_data_point.go b/services/postgresflex/model_instance_data_point.go index 65c54f4db..3293ad855 100644 --- a/services/postgresflex/model_instance_data_point.go +++ b/services/postgresflex/model_instance_data_point.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &InstanceDataPoint{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceDataPointGetTimestampAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceDataPointGetTimestampAttributeTypeOk(arg InstanceDataPointGetTimestampAttributeType) (ret InstanceDataPointGetTimestampRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getInstanceDataPointGetTimestampAttributeTypeOk(arg InstanceDataPointGetTim return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceDataPointGetTimestampAttributeType(arg *InstanceDataPointGetTimestampAttributeType, val InstanceDataPointGetTimestampRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceDataPointGetTimestampArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceDataPointGetTimestampRetType = string /* @@ -43,10 +50,16 @@ type InstanceDataPointGetTimestampRetType = string */ // isNumber +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceDataPointGetValueAttributeType = *float64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceDataPointGetValueArgType = float64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceDataPointGetValueRetType = float64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceDataPointGetValueAttributeTypeOk(arg InstanceDataPointGetValueAttributeType) (ret InstanceDataPointGetValueRetType, ok bool) { if arg == nil { return ret, false @@ -54,11 +67,13 @@ func getInstanceDataPointGetValueAttributeTypeOk(arg InstanceDataPointGetValueAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceDataPointGetValueAttributeType(arg *InstanceDataPointGetValueAttributeType, val InstanceDataPointGetValueRetType) { *arg = &val } // InstanceDataPoint struct for InstanceDataPoint +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceDataPoint struct { Timestamp InstanceDataPointGetTimestampAttributeType `json:"timestamp,omitempty"` Value InstanceDataPointGetValueAttributeType `json:"value,omitempty"` @@ -68,6 +83,7 @@ type InstanceDataPoint 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 NewInstanceDataPoint() *InstanceDataPoint { this := InstanceDataPoint{} return &this @@ -76,12 +92,14 @@ func NewInstanceDataPoint() *InstanceDataPoint { // NewInstanceDataPointWithDefaults instantiates a new InstanceDataPoint object // This 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 NewInstanceDataPointWithDefaults() *InstanceDataPoint { this := InstanceDataPoint{} return &this } // GetTimestamp returns the Timestamp field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceDataPoint) GetTimestamp() (res InstanceDataPointGetTimestampRetType) { res, _ = o.GetTimestampOk() return @@ -89,22 +107,26 @@ func (o *InstanceDataPoint) GetTimestamp() (res InstanceDataPointGetTimestampRet // GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceDataPoint) GetTimestampOk() (ret InstanceDataPointGetTimestampRetType, ok bool) { return getInstanceDataPointGetTimestampAttributeTypeOk(o.Timestamp) } // HasTimestamp returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceDataPoint) HasTimestamp() bool { _, ok := o.GetTimestampOk() return ok } // SetTimestamp gets a reference to the given string and assigns it to the Timestamp field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceDataPoint) SetTimestamp(v InstanceDataPointGetTimestampRetType) { setInstanceDataPointGetTimestampAttributeType(&o.Timestamp, v) } // GetValue returns the Value field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceDataPoint) GetValue() (res InstanceDataPointGetValueRetType) { res, _ = o.GetValueOk() return @@ -112,21 +134,25 @@ func (o *InstanceDataPoint) GetValue() (res InstanceDataPointGetValueRetType) { // GetValueOk returns a tuple with the Value field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceDataPoint) GetValueOk() (ret InstanceDataPointGetValueRetType, ok bool) { return getInstanceDataPointGetValueAttributeTypeOk(o.Value) } // HasValue returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceDataPoint) HasValue() bool { _, ok := o.GetValueOk() return ok } // SetValue gets a reference to the given float64 and assigns it to the Value field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceDataPoint) SetValue(v InstanceDataPointGetValueRetType) { setInstanceDataPointGetValueAttributeType(&o.Value, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o InstanceDataPoint) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getInstanceDataPointGetTimestampAttributeTypeOk(o.Timestamp); ok { @@ -138,37 +164,45 @@ func (o InstanceDataPoint) 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 NullableInstanceDataPoint struct { value *InstanceDataPoint isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInstanceDataPoint) Get() *InstanceDataPoint { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInstanceDataPoint) Set(val *InstanceDataPoint) { 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 NullableInstanceDataPoint) 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 *NullableInstanceDataPoint) 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 NewNullableInstanceDataPoint(val *InstanceDataPoint) *NullableInstanceDataPoint { return &NullableInstanceDataPoint{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 NullableInstanceDataPoint) 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 *NullableInstanceDataPoint) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_instance_database.go b/services/postgresflex/model_instance_database.go index 4a4477367..5e50ee2f1 100644 --- a/services/postgresflex/model_instance_database.go +++ b/services/postgresflex/model_instance_database.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &InstanceDatabase{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceDatabaseGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceDatabaseGetIdAttributeTypeOk(arg InstanceDatabaseGetIdAttributeType) (ret InstanceDatabaseGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getInstanceDatabaseGetIdAttributeTypeOk(arg InstanceDatabaseGetIdAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceDatabaseGetIdAttributeType(arg *InstanceDatabaseGetIdAttributeType, val InstanceDatabaseGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceDatabaseGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceDatabaseGetIdRetType = string /* @@ -43,8 +50,10 @@ type InstanceDatabaseGetIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceDatabaseGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceDatabaseGetNameAttributeTypeOk(arg InstanceDatabaseGetNameAttributeType) (ret InstanceDatabaseGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -52,11 +61,15 @@ func getInstanceDatabaseGetNameAttributeTypeOk(arg InstanceDatabaseGetNameAttrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceDatabaseGetNameAttributeType(arg *InstanceDatabaseGetNameAttributeType, val InstanceDatabaseGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceDatabaseGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceDatabaseGetNameRetType = string /* @@ -64,10 +77,16 @@ type InstanceDatabaseGetNameRetType = string */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceDatabaseGetOptionsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceDatabaseGetOptionsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceDatabaseGetOptionsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceDatabaseGetOptionsAttributeTypeOk(arg InstanceDatabaseGetOptionsAttributeType) (ret InstanceDatabaseGetOptionsRetType, ok bool) { if arg == nil { return ret, false @@ -75,11 +94,13 @@ func getInstanceDatabaseGetOptionsAttributeTypeOk(arg InstanceDatabaseGetOptions return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceDatabaseGetOptionsAttributeType(arg *InstanceDatabaseGetOptionsAttributeType, val InstanceDatabaseGetOptionsRetType) { *arg = &val } // InstanceDatabase struct for InstanceDatabase +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceDatabase struct { Id InstanceDatabaseGetIdAttributeType `json:"id,omitempty"` Name InstanceDatabaseGetNameAttributeType `json:"name,omitempty"` @@ -91,6 +112,7 @@ type InstanceDatabase 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 NewInstanceDatabase() *InstanceDatabase { this := InstanceDatabase{} return &this @@ -99,12 +121,14 @@ func NewInstanceDatabase() *InstanceDatabase { // NewInstanceDatabaseWithDefaults instantiates a new InstanceDatabase object // This 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 NewInstanceDatabaseWithDefaults() *InstanceDatabase { this := InstanceDatabase{} 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 *InstanceDatabase) GetId() (res InstanceDatabaseGetIdRetType) { res, _ = o.GetIdOk() return @@ -112,22 +136,26 @@ func (o *InstanceDatabase) GetId() (res InstanceDatabaseGetIdRetType) { // 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 *InstanceDatabase) GetIdOk() (ret InstanceDatabaseGetIdRetType, ok bool) { return getInstanceDatabaseGetIdAttributeTypeOk(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 *InstanceDatabase) 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 *InstanceDatabase) SetId(v InstanceDatabaseGetIdRetType) { setInstanceDatabaseGetIdAttributeType(&o.Id, 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 *InstanceDatabase) GetName() (res InstanceDatabaseGetNameRetType) { res, _ = o.GetNameOk() return @@ -135,22 +163,26 @@ func (o *InstanceDatabase) GetName() (res InstanceDatabaseGetNameRetType) { // 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 *InstanceDatabase) GetNameOk() (ret InstanceDatabaseGetNameRetType, ok bool) { return getInstanceDatabaseGetNameAttributeTypeOk(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 *InstanceDatabase) 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 *InstanceDatabase) SetName(v InstanceDatabaseGetNameRetType) { setInstanceDatabaseGetNameAttributeType(&o.Name, v) } // GetOptions returns the Options field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceDatabase) GetOptions() (res InstanceDatabaseGetOptionsRetType) { res, _ = o.GetOptionsOk() return @@ -158,21 +190,25 @@ func (o *InstanceDatabase) GetOptions() (res InstanceDatabaseGetOptionsRetType) // GetOptionsOk returns a tuple with the Options field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceDatabase) GetOptionsOk() (ret InstanceDatabaseGetOptionsRetType, ok bool) { return getInstanceDatabaseGetOptionsAttributeTypeOk(o.Options) } // HasOptions returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceDatabase) HasOptions() bool { _, ok := o.GetOptionsOk() return ok } // SetOptions gets a reference to the given map[string]interface{} and assigns it to the Options field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceDatabase) SetOptions(v InstanceDatabaseGetOptionsRetType) { setInstanceDatabaseGetOptionsAttributeType(&o.Options, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o InstanceDatabase) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getInstanceDatabaseGetIdAttributeTypeOk(o.Id); ok { @@ -187,37 +223,45 @@ func (o InstanceDatabase) 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 NullableInstanceDatabase struct { value *InstanceDatabase isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInstanceDatabase) Get() *InstanceDatabase { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInstanceDatabase) Set(val *InstanceDatabase) { 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 NullableInstanceDatabase) 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 *NullableInstanceDatabase) 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 NewNullableInstanceDatabase(val *InstanceDatabase) *NullableInstanceDatabase { return &NullableInstanceDatabase{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 NullableInstanceDatabase) 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 *NullableInstanceDatabase) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_instance_host.go b/services/postgresflex/model_instance_host.go index 3b1d615a3..d6e0077fb 100644 --- a/services/postgresflex/model_instance_host.go +++ b/services/postgresflex/model_instance_host.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &InstanceHost{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceHostGetHostMetricsAttributeType = *[]InstanceHostMetric + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceHostGetHostMetricsArgType = []InstanceHostMetric + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceHostGetHostMetricsRetType = []InstanceHostMetric +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceHostGetHostMetricsAttributeTypeOk(arg InstanceHostGetHostMetricsAttributeType) (ret InstanceHostGetHostMetricsRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getInstanceHostGetHostMetricsAttributeTypeOk(arg InstanceHostGetHostMetrics return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceHostGetHostMetricsAttributeType(arg *InstanceHostGetHostMetricsAttributeType, val InstanceHostGetHostMetricsRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setInstanceHostGetHostMetricsAttributeType(arg *InstanceHostGetHostMetricsA */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceHostGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceHostGetIdAttributeTypeOk(arg InstanceHostGetIdAttributeType) (ret InstanceHostGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -51,14 +61,19 @@ func getInstanceHostGetIdAttributeTypeOk(arg InstanceHostGetIdAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceHostGetIdAttributeType(arg *InstanceHostGetIdAttributeType, val InstanceHostGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceHostGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceHostGetIdRetType = string // InstanceHost struct for InstanceHost +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceHost struct { HostMetrics InstanceHostGetHostMetricsAttributeType `json:"hostMetrics,omitempty"` Id InstanceHostGetIdAttributeType `json:"id,omitempty"` @@ -68,6 +83,7 @@ type InstanceHost 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 NewInstanceHost() *InstanceHost { this := InstanceHost{} return &this @@ -76,12 +92,14 @@ func NewInstanceHost() *InstanceHost { // NewInstanceHostWithDefaults instantiates a new InstanceHost object // This 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 NewInstanceHostWithDefaults() *InstanceHost { this := InstanceHost{} return &this } // GetHostMetrics returns the HostMetrics field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceHost) GetHostMetrics() (res InstanceHostGetHostMetricsRetType) { res, _ = o.GetHostMetricsOk() return @@ -89,22 +107,26 @@ func (o *InstanceHost) GetHostMetrics() (res InstanceHostGetHostMetricsRetType) // GetHostMetricsOk returns a tuple with the HostMetrics field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceHost) GetHostMetricsOk() (ret InstanceHostGetHostMetricsRetType, ok bool) { return getInstanceHostGetHostMetricsAttributeTypeOk(o.HostMetrics) } // HasHostMetrics returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceHost) HasHostMetrics() bool { _, ok := o.GetHostMetricsOk() return ok } // SetHostMetrics gets a reference to the given []InstanceHostMetric and assigns it to the HostMetrics field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceHost) SetHostMetrics(v InstanceHostGetHostMetricsRetType) { setInstanceHostGetHostMetricsAttributeType(&o.HostMetrics, 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 *InstanceHost) GetId() (res InstanceHostGetIdRetType) { res, _ = o.GetIdOk() return @@ -112,21 +134,25 @@ func (o *InstanceHost) GetId() (res InstanceHostGetIdRetType) { // 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 *InstanceHost) GetIdOk() (ret InstanceHostGetIdRetType, ok bool) { return getInstanceHostGetIdAttributeTypeOk(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 *InstanceHost) 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 *InstanceHost) SetId(v InstanceHostGetIdRetType) { setInstanceHostGetIdAttributeType(&o.Id, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o InstanceHost) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getInstanceHostGetHostMetricsAttributeTypeOk(o.HostMetrics); ok { @@ -138,37 +164,45 @@ func (o InstanceHost) 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 NullableInstanceHost struct { value *InstanceHost isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInstanceHost) Get() *InstanceHost { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInstanceHost) Set(val *InstanceHost) { 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 NullableInstanceHost) 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 *NullableInstanceHost) 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 NewNullableInstanceHost(val *InstanceHost) *NullableInstanceHost { return &NullableInstanceHost{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 NullableInstanceHost) 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 *NullableInstanceHost) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_instance_host_metric.go b/services/postgresflex/model_instance_host_metric.go index e82764346..b102acf1a 100644 --- a/services/postgresflex/model_instance_host_metric.go +++ b/services/postgresflex/model_instance_host_metric.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &InstanceHostMetric{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceHostMetricGetDatapointsAttributeType = *[]InstanceDataPoint + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceHostMetricGetDatapointsArgType = []InstanceDataPoint + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceHostMetricGetDatapointsRetType = []InstanceDataPoint +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceHostMetricGetDatapointsAttributeTypeOk(arg InstanceHostMetricGetDatapointsAttributeType) (ret InstanceHostMetricGetDatapointsRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getInstanceHostMetricGetDatapointsAttributeTypeOk(arg InstanceHostMetricGet return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceHostMetricGetDatapointsAttributeType(arg *InstanceHostMetricGetDatapointsAttributeType, val InstanceHostMetricGetDatapointsRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setInstanceHostMetricGetDatapointsAttributeType(arg *InstanceHostMetricGetD */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceHostMetricGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceHostMetricGetNameAttributeTypeOk(arg InstanceHostMetricGetNameAttributeType) (ret InstanceHostMetricGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -51,11 +61,15 @@ func getInstanceHostMetricGetNameAttributeTypeOk(arg InstanceHostMetricGetNameAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceHostMetricGetNameAttributeType(arg *InstanceHostMetricGetNameAttributeType, val InstanceHostMetricGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceHostMetricGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceHostMetricGetNameRetType = string /* @@ -63,8 +77,10 @@ type InstanceHostMetricGetNameRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceHostMetricGetUnitsAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceHostMetricGetUnitsAttributeTypeOk(arg InstanceHostMetricGetUnitsAttributeType) (ret InstanceHostMetricGetUnitsRetType, ok bool) { if arg == nil { return ret, false @@ -72,14 +88,19 @@ func getInstanceHostMetricGetUnitsAttributeTypeOk(arg InstanceHostMetricGetUnits return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceHostMetricGetUnitsAttributeType(arg *InstanceHostMetricGetUnitsAttributeType, val InstanceHostMetricGetUnitsRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceHostMetricGetUnitsArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceHostMetricGetUnitsRetType = string // InstanceHostMetric struct for InstanceHostMetric +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceHostMetric struct { Datapoints InstanceHostMetricGetDatapointsAttributeType `json:"datapoints,omitempty"` Name InstanceHostMetricGetNameAttributeType `json:"name,omitempty"` @@ -90,6 +111,7 @@ type InstanceHostMetric 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 NewInstanceHostMetric() *InstanceHostMetric { this := InstanceHostMetric{} return &this @@ -98,12 +120,14 @@ func NewInstanceHostMetric() *InstanceHostMetric { // NewInstanceHostMetricWithDefaults instantiates a new InstanceHostMetric object // This 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 NewInstanceHostMetricWithDefaults() *InstanceHostMetric { this := InstanceHostMetric{} return &this } // GetDatapoints returns the Datapoints field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceHostMetric) GetDatapoints() (res InstanceHostMetricGetDatapointsRetType) { res, _ = o.GetDatapointsOk() return @@ -111,22 +135,26 @@ func (o *InstanceHostMetric) GetDatapoints() (res InstanceHostMetricGetDatapoint // GetDatapointsOk returns a tuple with the Datapoints field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceHostMetric) GetDatapointsOk() (ret InstanceHostMetricGetDatapointsRetType, ok bool) { return getInstanceHostMetricGetDatapointsAttributeTypeOk(o.Datapoints) } // HasDatapoints returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceHostMetric) HasDatapoints() bool { _, ok := o.GetDatapointsOk() return ok } // SetDatapoints gets a reference to the given []InstanceDataPoint and assigns it to the Datapoints field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceHostMetric) SetDatapoints(v InstanceHostMetricGetDatapointsRetType) { setInstanceHostMetricGetDatapointsAttributeType(&o.Datapoints, 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 *InstanceHostMetric) GetName() (res InstanceHostMetricGetNameRetType) { res, _ = o.GetNameOk() return @@ -134,22 +162,26 @@ func (o *InstanceHostMetric) GetName() (res InstanceHostMetricGetNameRetType) { // 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 *InstanceHostMetric) GetNameOk() (ret InstanceHostMetricGetNameRetType, ok bool) { return getInstanceHostMetricGetNameAttributeTypeOk(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 *InstanceHostMetric) 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 *InstanceHostMetric) SetName(v InstanceHostMetricGetNameRetType) { setInstanceHostMetricGetNameAttributeType(&o.Name, v) } // GetUnits returns the Units field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceHostMetric) GetUnits() (res InstanceHostMetricGetUnitsRetType) { res, _ = o.GetUnitsOk() return @@ -157,21 +189,25 @@ func (o *InstanceHostMetric) GetUnits() (res InstanceHostMetricGetUnitsRetType) // GetUnitsOk returns a tuple with the Units field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceHostMetric) GetUnitsOk() (ret InstanceHostMetricGetUnitsRetType, ok bool) { return getInstanceHostMetricGetUnitsAttributeTypeOk(o.Units) } // HasUnits returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceHostMetric) HasUnits() bool { _, ok := o.GetUnitsOk() return ok } // SetUnits gets a reference to the given string and assigns it to the Units field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceHostMetric) SetUnits(v InstanceHostMetricGetUnitsRetType) { setInstanceHostMetricGetUnitsAttributeType(&o.Units, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o InstanceHostMetric) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getInstanceHostMetricGetDatapointsAttributeTypeOk(o.Datapoints); ok { @@ -186,37 +222,45 @@ func (o InstanceHostMetric) 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 NullableInstanceHostMetric struct { value *InstanceHostMetric isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInstanceHostMetric) Get() *InstanceHostMetric { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInstanceHostMetric) Set(val *InstanceHostMetric) { 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 NullableInstanceHostMetric) 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 *NullableInstanceHostMetric) 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 NewNullableInstanceHostMetric(val *InstanceHostMetric) *NullableInstanceHostMetric { return &NullableInstanceHostMetric{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 NullableInstanceHostMetric) 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 *NullableInstanceHostMetric) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_instance_list_databases_response.go b/services/postgresflex/model_instance_list_databases_response.go index 030d62ab6..78117830a 100644 --- a/services/postgresflex/model_instance_list_databases_response.go +++ b/services/postgresflex/model_instance_list_databases_response.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &InstanceListDatabasesResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceListDatabasesResponseGetDatabasesAttributeType = *[]InstanceDatabase + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceListDatabasesResponseGetDatabasesArgType = []InstanceDatabase + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceListDatabasesResponseGetDatabasesRetType = []InstanceDatabase +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceListDatabasesResponseGetDatabasesAttributeTypeOk(arg InstanceListDatabasesResponseGetDatabasesAttributeType) (ret InstanceListDatabasesResponseGetDatabasesRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getInstanceListDatabasesResponseGetDatabasesAttributeTypeOk(arg InstanceLis return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceListDatabasesResponseGetDatabasesAttributeType(arg *InstanceListDatabasesResponseGetDatabasesAttributeType, val InstanceListDatabasesResponseGetDatabasesRetType) { *arg = &val } // InstanceListDatabasesResponse struct for InstanceListDatabasesResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceListDatabasesResponse struct { Databases InstanceListDatabasesResponseGetDatabasesAttributeType `json:"databases,omitempty"` } @@ -46,6 +55,7 @@ type InstanceListDatabasesResponse 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 NewInstanceListDatabasesResponse() *InstanceListDatabasesResponse { this := InstanceListDatabasesResponse{} return &this @@ -54,12 +64,14 @@ func NewInstanceListDatabasesResponse() *InstanceListDatabasesResponse { // NewInstanceListDatabasesResponseWithDefaults instantiates a new InstanceListDatabasesResponse object // This 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 NewInstanceListDatabasesResponseWithDefaults() *InstanceListDatabasesResponse { this := InstanceListDatabasesResponse{} return &this } // GetDatabases returns the Databases field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceListDatabasesResponse) GetDatabases() (res InstanceListDatabasesResponseGetDatabasesRetType) { res, _ = o.GetDatabasesOk() return @@ -67,21 +79,25 @@ func (o *InstanceListDatabasesResponse) GetDatabases() (res InstanceListDatabase // GetDatabasesOk returns a tuple with the Databases field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceListDatabasesResponse) GetDatabasesOk() (ret InstanceListDatabasesResponseGetDatabasesRetType, ok bool) { return getInstanceListDatabasesResponseGetDatabasesAttributeTypeOk(o.Databases) } // HasDatabases returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceListDatabasesResponse) HasDatabases() bool { _, ok := o.GetDatabasesOk() return ok } // SetDatabases gets a reference to the given []InstanceDatabase and assigns it to the Databases field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceListDatabasesResponse) SetDatabases(v InstanceListDatabasesResponseGetDatabasesRetType) { setInstanceListDatabasesResponseGetDatabasesAttributeType(&o.Databases, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o InstanceListDatabasesResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getInstanceListDatabasesResponseGetDatabasesAttributeTypeOk(o.Databases); ok { @@ -90,37 +106,45 @@ func (o InstanceListDatabasesResponse) 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 NullableInstanceListDatabasesResponse struct { value *InstanceListDatabasesResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInstanceListDatabasesResponse) Get() *InstanceListDatabasesResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInstanceListDatabasesResponse) Set(val *InstanceListDatabasesResponse) { 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 NullableInstanceListDatabasesResponse) 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 *NullableInstanceListDatabasesResponse) 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 NewNullableInstanceListDatabasesResponse(val *InstanceListDatabasesResponse) *NullableInstanceListDatabasesResponse { return &NullableInstanceListDatabasesResponse{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 NullableInstanceListDatabasesResponse) 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 *NullableInstanceListDatabasesResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_instance_list_instance.go b/services/postgresflex/model_instance_list_instance.go index 6cf3e5bdf..66aa2e44e 100644 --- a/services/postgresflex/model_instance_list_instance.go +++ b/services/postgresflex/model_instance_list_instance.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &InstanceListInstance{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceListInstanceGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceListInstanceGetIdAttributeTypeOk(arg InstanceListInstanceGetIdAttributeType) (ret InstanceListInstanceGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getInstanceListInstanceGetIdAttributeTypeOk(arg InstanceListInstanceGetIdAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceListInstanceGetIdAttributeType(arg *InstanceListInstanceGetIdAttributeType, val InstanceListInstanceGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceListInstanceGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceListInstanceGetIdRetType = string /* @@ -43,8 +50,10 @@ type InstanceListInstanceGetIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceListInstanceGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceListInstanceGetNameAttributeTypeOk(arg InstanceListInstanceGetNameAttributeType) (ret InstanceListInstanceGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -52,11 +61,15 @@ func getInstanceListInstanceGetNameAttributeTypeOk(arg InstanceListInstanceGetNa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceListInstanceGetNameAttributeType(arg *InstanceListInstanceGetNameAttributeType, val InstanceListInstanceGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceListInstanceGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceListInstanceGetNameRetType = string /* @@ -64,8 +77,10 @@ type InstanceListInstanceGetNameRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceListInstanceGetStatusAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceListInstanceGetStatusAttributeTypeOk(arg InstanceListInstanceGetStatusAttributeType) (ret InstanceListInstanceGetStatusRetType, ok bool) { if arg == nil { return ret, false @@ -73,14 +88,19 @@ func getInstanceListInstanceGetStatusAttributeTypeOk(arg InstanceListInstanceGet return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceListInstanceGetStatusAttributeType(arg *InstanceListInstanceGetStatusAttributeType, val InstanceListInstanceGetStatusRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceListInstanceGetStatusArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceListInstanceGetStatusRetType = string // InstanceListInstance struct for InstanceListInstance +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceListInstance struct { Id InstanceListInstanceGetIdAttributeType `json:"id,omitempty"` Name InstanceListInstanceGetNameAttributeType `json:"name,omitempty"` @@ -91,6 +111,7 @@ type InstanceListInstance 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 NewInstanceListInstance() *InstanceListInstance { this := InstanceListInstance{} return &this @@ -99,12 +120,14 @@ func NewInstanceListInstance() *InstanceListInstance { // NewInstanceListInstanceWithDefaults instantiates a new InstanceListInstance object // This 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 NewInstanceListInstanceWithDefaults() *InstanceListInstance { this := InstanceListInstance{} 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 *InstanceListInstance) GetId() (res InstanceListInstanceGetIdRetType) { res, _ = o.GetIdOk() return @@ -112,22 +135,26 @@ func (o *InstanceListInstance) GetId() (res InstanceListInstanceGetIdRetType) { // 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 *InstanceListInstance) GetIdOk() (ret InstanceListInstanceGetIdRetType, ok bool) { return getInstanceListInstanceGetIdAttributeTypeOk(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 *InstanceListInstance) 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 *InstanceListInstance) SetId(v InstanceListInstanceGetIdRetType) { setInstanceListInstanceGetIdAttributeType(&o.Id, 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 *InstanceListInstance) GetName() (res InstanceListInstanceGetNameRetType) { res, _ = o.GetNameOk() return @@ -135,22 +162,26 @@ func (o *InstanceListInstance) GetName() (res InstanceListInstanceGetNameRetType // 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 *InstanceListInstance) GetNameOk() (ret InstanceListInstanceGetNameRetType, ok bool) { return getInstanceListInstanceGetNameAttributeTypeOk(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 *InstanceListInstance) 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 *InstanceListInstance) SetName(v InstanceListInstanceGetNameRetType) { setInstanceListInstanceGetNameAttributeType(&o.Name, 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 *InstanceListInstance) GetStatus() (res InstanceListInstanceGetStatusRetType) { res, _ = o.GetStatusOk() return @@ -158,21 +189,25 @@ func (o *InstanceListInstance) GetStatus() (res InstanceListInstanceGetStatusRet // 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 *InstanceListInstance) GetStatusOk() (ret InstanceListInstanceGetStatusRetType, ok bool) { return getInstanceListInstanceGetStatusAttributeTypeOk(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 *InstanceListInstance) 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 *InstanceListInstance) SetStatus(v InstanceListInstanceGetStatusRetType) { setInstanceListInstanceGetStatusAttributeType(&o.Status, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o InstanceListInstance) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getInstanceListInstanceGetIdAttributeTypeOk(o.Id); ok { @@ -187,37 +222,45 @@ func (o InstanceListInstance) 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 NullableInstanceListInstance struct { value *InstanceListInstance isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInstanceListInstance) Get() *InstanceListInstance { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInstanceListInstance) Set(val *InstanceListInstance) { 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 NullableInstanceListInstance) 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 *NullableInstanceListInstance) 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 NewNullableInstanceListInstance(val *InstanceListInstance) *NullableInstanceListInstance { return &NullableInstanceListInstance{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 NullableInstanceListInstance) 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 *NullableInstanceListInstance) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_instance_metrics_response.go b/services/postgresflex/model_instance_metrics_response.go index 10042cbc9..eb02743ed 100644 --- a/services/postgresflex/model_instance_metrics_response.go +++ b/services/postgresflex/model_instance_metrics_response.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &InstanceMetricsResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceMetricsResponseGetHostsAttributeType = *[]InstanceHost + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceMetricsResponseGetHostsArgType = []InstanceHost + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceMetricsResponseGetHostsRetType = []InstanceHost +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceMetricsResponseGetHostsAttributeTypeOk(arg InstanceMetricsResponseGetHostsAttributeType) (ret InstanceMetricsResponseGetHostsRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getInstanceMetricsResponseGetHostsAttributeTypeOk(arg InstanceMetricsRespon return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceMetricsResponseGetHostsAttributeType(arg *InstanceMetricsResponseGetHostsAttributeType, val InstanceMetricsResponseGetHostsRetType) { *arg = &val } // InstanceMetricsResponse struct for InstanceMetricsResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceMetricsResponse struct { Hosts InstanceMetricsResponseGetHostsAttributeType `json:"hosts,omitempty"` } @@ -46,6 +55,7 @@ type InstanceMetricsResponse 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 NewInstanceMetricsResponse() *InstanceMetricsResponse { this := InstanceMetricsResponse{} return &this @@ -54,12 +64,14 @@ func NewInstanceMetricsResponse() *InstanceMetricsResponse { // NewInstanceMetricsResponseWithDefaults instantiates a new InstanceMetricsResponse object // This 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 NewInstanceMetricsResponseWithDefaults() *InstanceMetricsResponse { this := InstanceMetricsResponse{} return &this } // GetHosts returns the Hosts field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceMetricsResponse) GetHosts() (res InstanceMetricsResponseGetHostsRetType) { res, _ = o.GetHostsOk() return @@ -67,21 +79,25 @@ func (o *InstanceMetricsResponse) GetHosts() (res InstanceMetricsResponseGetHost // GetHostsOk returns a tuple with the Hosts field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceMetricsResponse) GetHostsOk() (ret InstanceMetricsResponseGetHostsRetType, ok bool) { return getInstanceMetricsResponseGetHostsAttributeTypeOk(o.Hosts) } // HasHosts returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceMetricsResponse) HasHosts() bool { _, ok := o.GetHostsOk() return ok } // SetHosts gets a reference to the given []InstanceHost and assigns it to the Hosts field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceMetricsResponse) SetHosts(v InstanceMetricsResponseGetHostsRetType) { setInstanceMetricsResponseGetHostsAttributeType(&o.Hosts, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o InstanceMetricsResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getInstanceMetricsResponseGetHostsAttributeTypeOk(o.Hosts); ok { @@ -90,37 +106,45 @@ func (o InstanceMetricsResponse) 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 NullableInstanceMetricsResponse struct { value *InstanceMetricsResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInstanceMetricsResponse) Get() *InstanceMetricsResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInstanceMetricsResponse) Set(val *InstanceMetricsResponse) { 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 NullableInstanceMetricsResponse) 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 *NullableInstanceMetricsResponse) 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 NewNullableInstanceMetricsResponse(val *InstanceMetricsResponse) *NullableInstanceMetricsResponse { return &NullableInstanceMetricsResponse{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 NullableInstanceMetricsResponse) 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 *NullableInstanceMetricsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_instance_response.go b/services/postgresflex/model_instance_response.go index 08fc15498..39aa53cb7 100644 --- a/services/postgresflex/model_instance_response.go +++ b/services/postgresflex/model_instance_response.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &InstanceResponse{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceResponseGetItemAttributeType = *Instance + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceResponseGetItemArgType = Instance + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceResponseGetItemRetType = Instance +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceResponseGetItemAttributeTypeOk(arg InstanceResponseGetItemAttributeType) (ret InstanceResponseGetItemRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getInstanceResponseGetItemAttributeTypeOk(arg InstanceResponseGetItemAttrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceResponseGetItemAttributeType(arg *InstanceResponseGetItemAttributeType, val InstanceResponseGetItemRetType) { *arg = &val } // InstanceResponse struct for InstanceResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceResponse struct { Item InstanceResponseGetItemAttributeType `json:"item,omitempty"` } @@ -46,6 +55,7 @@ type InstanceResponse 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 NewInstanceResponse() *InstanceResponse { this := InstanceResponse{} return &this @@ -54,12 +64,14 @@ func NewInstanceResponse() *InstanceResponse { // NewInstanceResponseWithDefaults instantiates a new InstanceResponse object // This 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 NewInstanceResponseWithDefaults() *InstanceResponse { this := InstanceResponse{} return &this } // GetItem returns the Item field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceResponse) GetItem() (res InstanceResponseGetItemRetType) { res, _ = o.GetItemOk() return @@ -67,21 +79,25 @@ func (o *InstanceResponse) GetItem() (res InstanceResponseGetItemRetType) { // GetItemOk returns a tuple with the Item field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceResponse) GetItemOk() (ret InstanceResponseGetItemRetType, ok bool) { return getInstanceResponseGetItemAttributeTypeOk(o.Item) } // HasItem returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceResponse) HasItem() bool { _, ok := o.GetItemOk() return ok } // SetItem gets a reference to the given Instance and assigns it to the Item field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceResponse) SetItem(v InstanceResponseGetItemRetType) { setInstanceResponseGetItemAttributeType(&o.Item, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o InstanceResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getInstanceResponseGetItemAttributeTypeOk(o.Item); ok { @@ -90,37 +106,45 @@ func (o InstanceResponse) 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 NullableInstanceResponse struct { value *InstanceResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInstanceResponse) Get() *InstanceResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInstanceResponse) Set(val *InstanceResponse) { 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 NullableInstanceResponse) 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 *NullableInstanceResponse) 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 NewNullableInstanceResponse(val *InstanceResponse) *NullableInstanceResponse { return &NullableInstanceResponse{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 NullableInstanceResponse) 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 *NullableInstanceResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_list_backups_response.go b/services/postgresflex/model_list_backups_response.go index d083d437b..28b2aba27 100644 --- a/services/postgresflex/model_list_backups_response.go +++ b/services/postgresflex/model_list_backups_response.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ListBackupsResponse{} */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListBackupsResponseGetCountAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListBackupsResponseGetCountArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListBackupsResponseGetCountRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getListBackupsResponseGetCountAttributeTypeOk(arg ListBackupsResponseGetCountAttributeType) (ret ListBackupsResponseGetCountRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getListBackupsResponseGetCountAttributeTypeOk(arg ListBackupsResponseGetCou return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setListBackupsResponseGetCountAttributeType(arg *ListBackupsResponseGetCountAttributeType, val ListBackupsResponseGetCountRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setListBackupsResponseGetCountAttributeType(arg *ListBackupsResponseGetCoun */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListBackupsResponseGetItemsAttributeType = *[]Backup + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListBackupsResponseGetItemsArgType = []Backup + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListBackupsResponseGetItemsRetType = []Backup +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getListBackupsResponseGetItemsAttributeTypeOk(arg ListBackupsResponseGetItemsAttributeType) (ret ListBackupsResponseGetItemsRetType, ok bool) { if arg == nil { return ret, false @@ -53,11 +67,13 @@ func getListBackupsResponseGetItemsAttributeTypeOk(arg ListBackupsResponseGetIte return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setListBackupsResponseGetItemsAttributeType(arg *ListBackupsResponseGetItemsAttributeType, val ListBackupsResponseGetItemsRetType) { *arg = &val } // ListBackupsResponse struct for ListBackupsResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListBackupsResponse struct { Count ListBackupsResponseGetCountAttributeType `json:"count,omitempty"` Items ListBackupsResponseGetItemsAttributeType `json:"items,omitempty"` @@ -67,6 +83,7 @@ type ListBackupsResponse 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 NewListBackupsResponse() *ListBackupsResponse { this := ListBackupsResponse{} return &this @@ -75,12 +92,14 @@ func NewListBackupsResponse() *ListBackupsResponse { // NewListBackupsResponseWithDefaults instantiates a new ListBackupsResponse object // This 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 NewListBackupsResponseWithDefaults() *ListBackupsResponse { this := ListBackupsResponse{} return &this } // GetCount returns the Count field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListBackupsResponse) GetCount() (res ListBackupsResponseGetCountRetType) { res, _ = o.GetCountOk() return @@ -88,22 +107,26 @@ func (o *ListBackupsResponse) GetCount() (res ListBackupsResponseGetCountRetType // GetCountOk returns a tuple with the Count field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListBackupsResponse) GetCountOk() (ret ListBackupsResponseGetCountRetType, ok bool) { return getListBackupsResponseGetCountAttributeTypeOk(o.Count) } // HasCount returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListBackupsResponse) HasCount() bool { _, ok := o.GetCountOk() return ok } // SetCount gets a reference to the given int64 and assigns it to the Count field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListBackupsResponse) SetCount(v ListBackupsResponseGetCountRetType) { setListBackupsResponseGetCountAttributeType(&o.Count, v) } // GetItems returns the Items field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListBackupsResponse) GetItems() (res ListBackupsResponseGetItemsRetType) { res, _ = o.GetItemsOk() return @@ -111,21 +134,25 @@ func (o *ListBackupsResponse) GetItems() (res ListBackupsResponseGetItemsRetType // GetItemsOk returns a tuple with the Items field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListBackupsResponse) GetItemsOk() (ret ListBackupsResponseGetItemsRetType, ok bool) { return getListBackupsResponseGetItemsAttributeTypeOk(o.Items) } // HasItems returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListBackupsResponse) HasItems() bool { _, ok := o.GetItemsOk() return ok } // SetItems gets a reference to the given []Backup and assigns it to the Items field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListBackupsResponse) SetItems(v ListBackupsResponseGetItemsRetType) { setListBackupsResponseGetItemsAttributeType(&o.Items, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ListBackupsResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getListBackupsResponseGetCountAttributeTypeOk(o.Count); ok { @@ -137,37 +164,45 @@ func (o ListBackupsResponse) 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 NullableListBackupsResponse struct { value *ListBackupsResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableListBackupsResponse) Get() *ListBackupsResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableListBackupsResponse) Set(val *ListBackupsResponse) { 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 NullableListBackupsResponse) 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 *NullableListBackupsResponse) 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 NewNullableListBackupsResponse(val *ListBackupsResponse) *NullableListBackupsResponse { return &NullableListBackupsResponse{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 NullableListBackupsResponse) 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 *NullableListBackupsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_list_flavors_response.go b/services/postgresflex/model_list_flavors_response.go index b26b5744c..3216c94a1 100644 --- a/services/postgresflex/model_list_flavors_response.go +++ b/services/postgresflex/model_list_flavors_response.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ListFlavorsResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListFlavorsResponseGetFlavorsAttributeType = *[]Flavor + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListFlavorsResponseGetFlavorsArgType = []Flavor + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListFlavorsResponseGetFlavorsRetType = []Flavor +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getListFlavorsResponseGetFlavorsAttributeTypeOk(arg ListFlavorsResponseGetFlavorsAttributeType) (ret ListFlavorsResponseGetFlavorsRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getListFlavorsResponseGetFlavorsAttributeTypeOk(arg ListFlavorsResponseGetF return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setListFlavorsResponseGetFlavorsAttributeType(arg *ListFlavorsResponseGetFlavorsAttributeType, val ListFlavorsResponseGetFlavorsRetType) { *arg = &val } // ListFlavorsResponse struct for ListFlavorsResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListFlavorsResponse struct { Flavors ListFlavorsResponseGetFlavorsAttributeType `json:"flavors,omitempty"` } @@ -46,6 +55,7 @@ type ListFlavorsResponse 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 NewListFlavorsResponse() *ListFlavorsResponse { this := ListFlavorsResponse{} return &this @@ -54,12 +64,14 @@ func NewListFlavorsResponse() *ListFlavorsResponse { // NewListFlavorsResponseWithDefaults instantiates a new ListFlavorsResponse object // This 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 NewListFlavorsResponseWithDefaults() *ListFlavorsResponse { this := ListFlavorsResponse{} return &this } // GetFlavors returns the Flavors field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListFlavorsResponse) GetFlavors() (res ListFlavorsResponseGetFlavorsRetType) { res, _ = o.GetFlavorsOk() return @@ -67,21 +79,25 @@ func (o *ListFlavorsResponse) GetFlavors() (res ListFlavorsResponseGetFlavorsRet // GetFlavorsOk returns a tuple with the Flavors field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListFlavorsResponse) GetFlavorsOk() (ret ListFlavorsResponseGetFlavorsRetType, ok bool) { return getListFlavorsResponseGetFlavorsAttributeTypeOk(o.Flavors) } // HasFlavors returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListFlavorsResponse) HasFlavors() bool { _, ok := o.GetFlavorsOk() return ok } // SetFlavors gets a reference to the given []Flavor and assigns it to the Flavors field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListFlavorsResponse) SetFlavors(v ListFlavorsResponseGetFlavorsRetType) { setListFlavorsResponseGetFlavorsAttributeType(&o.Flavors, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ListFlavorsResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getListFlavorsResponseGetFlavorsAttributeTypeOk(o.Flavors); ok { @@ -90,37 +106,45 @@ func (o ListFlavorsResponse) 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 NullableListFlavorsResponse struct { value *ListFlavorsResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableListFlavorsResponse) Get() *ListFlavorsResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableListFlavorsResponse) Set(val *ListFlavorsResponse) { 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 NullableListFlavorsResponse) 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 *NullableListFlavorsResponse) 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 NewNullableListFlavorsResponse(val *ListFlavorsResponse) *NullableListFlavorsResponse { return &NullableListFlavorsResponse{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 NullableListFlavorsResponse) 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 *NullableListFlavorsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_list_instances_response.go b/services/postgresflex/model_list_instances_response.go index cd66d0b36..e0f04a7dc 100644 --- a/services/postgresflex/model_list_instances_response.go +++ b/services/postgresflex/model_list_instances_response.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ListInstancesResponse{} */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListInstancesResponseGetCountAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListInstancesResponseGetCountArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListInstancesResponseGetCountRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getListInstancesResponseGetCountAttributeTypeOk(arg ListInstancesResponseGetCountAttributeType) (ret ListInstancesResponseGetCountRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getListInstancesResponseGetCountAttributeTypeOk(arg ListInstancesResponseGe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setListInstancesResponseGetCountAttributeType(arg *ListInstancesResponseGetCountAttributeType, val ListInstancesResponseGetCountRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setListInstancesResponseGetCountAttributeType(arg *ListInstancesResponseGet */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListInstancesResponseGetItemsAttributeType = *[]InstanceListInstance + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListInstancesResponseGetItemsArgType = []InstanceListInstance + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListInstancesResponseGetItemsRetType = []InstanceListInstance +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getListInstancesResponseGetItemsAttributeTypeOk(arg ListInstancesResponseGetItemsAttributeType) (ret ListInstancesResponseGetItemsRetType, ok bool) { if arg == nil { return ret, false @@ -53,11 +67,13 @@ func getListInstancesResponseGetItemsAttributeTypeOk(arg ListInstancesResponseGe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setListInstancesResponseGetItemsAttributeType(arg *ListInstancesResponseGetItemsAttributeType, val ListInstancesResponseGetItemsRetType) { *arg = &val } // ListInstancesResponse struct for ListInstancesResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListInstancesResponse struct { Count ListInstancesResponseGetCountAttributeType `json:"count,omitempty"` Items ListInstancesResponseGetItemsAttributeType `json:"items,omitempty"` @@ -67,6 +83,7 @@ type ListInstancesResponse 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 NewListInstancesResponse() *ListInstancesResponse { this := ListInstancesResponse{} return &this @@ -75,12 +92,14 @@ func NewListInstancesResponse() *ListInstancesResponse { // NewListInstancesResponseWithDefaults instantiates a new ListInstancesResponse object // This 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 NewListInstancesResponseWithDefaults() *ListInstancesResponse { this := ListInstancesResponse{} return &this } // GetCount returns the Count field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListInstancesResponse) GetCount() (res ListInstancesResponseGetCountRetType) { res, _ = o.GetCountOk() return @@ -88,22 +107,26 @@ func (o *ListInstancesResponse) GetCount() (res ListInstancesResponseGetCountRet // GetCountOk returns a tuple with the Count field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListInstancesResponse) GetCountOk() (ret ListInstancesResponseGetCountRetType, ok bool) { return getListInstancesResponseGetCountAttributeTypeOk(o.Count) } // HasCount returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListInstancesResponse) HasCount() bool { _, ok := o.GetCountOk() return ok } // SetCount gets a reference to the given int64 and assigns it to the Count field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListInstancesResponse) SetCount(v ListInstancesResponseGetCountRetType) { setListInstancesResponseGetCountAttributeType(&o.Count, v) } // GetItems returns the Items field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListInstancesResponse) GetItems() (res ListInstancesResponseGetItemsRetType) { res, _ = o.GetItemsOk() return @@ -111,21 +134,25 @@ func (o *ListInstancesResponse) GetItems() (res ListInstancesResponseGetItemsRet // GetItemsOk returns a tuple with the Items field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListInstancesResponse) GetItemsOk() (ret ListInstancesResponseGetItemsRetType, ok bool) { return getListInstancesResponseGetItemsAttributeTypeOk(o.Items) } // HasItems returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListInstancesResponse) HasItems() bool { _, ok := o.GetItemsOk() return ok } // SetItems gets a reference to the given []InstanceListInstance and assigns it to the Items field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListInstancesResponse) SetItems(v ListInstancesResponseGetItemsRetType) { setListInstancesResponseGetItemsAttributeType(&o.Items, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ListInstancesResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getListInstancesResponseGetCountAttributeTypeOk(o.Count); ok { @@ -137,37 +164,45 @@ func (o ListInstancesResponse) 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 NullableListInstancesResponse struct { value *ListInstancesResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableListInstancesResponse) Get() *ListInstancesResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableListInstancesResponse) Set(val *ListInstancesResponse) { 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 NullableListInstancesResponse) 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 *NullableListInstancesResponse) 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 NewNullableListInstancesResponse(val *ListInstancesResponse) *NullableListInstancesResponse { return &NullableListInstancesResponse{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 NullableListInstancesResponse) 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 *NullableListInstancesResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_list_storages_response.go b/services/postgresflex/model_list_storages_response.go index 924970d0b..d1b0f5691 100644 --- a/services/postgresflex/model_list_storages_response.go +++ b/services/postgresflex/model_list_storages_response.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ListStoragesResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListStoragesResponseGetStorageClassesAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListStoragesResponseGetStorageClassesArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListStoragesResponseGetStorageClassesRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getListStoragesResponseGetStorageClassesAttributeTypeOk(arg ListStoragesResponseGetStorageClassesAttributeType) (ret ListStoragesResponseGetStorageClassesRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getListStoragesResponseGetStorageClassesAttributeTypeOk(arg ListStoragesRes return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setListStoragesResponseGetStorageClassesAttributeType(arg *ListStoragesResponseGetStorageClassesAttributeType, val ListStoragesResponseGetStorageClassesRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setListStoragesResponseGetStorageClassesAttributeType(arg *ListStoragesResp */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListStoragesResponseGetStorageRangeAttributeType = *StorageRange + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListStoragesResponseGetStorageRangeArgType = StorageRange + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListStoragesResponseGetStorageRangeRetType = StorageRange +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getListStoragesResponseGetStorageRangeAttributeTypeOk(arg ListStoragesResponseGetStorageRangeAttributeType) (ret ListStoragesResponseGetStorageRangeRetType, ok bool) { if arg == nil { return ret, false @@ -53,11 +67,13 @@ func getListStoragesResponseGetStorageRangeAttributeTypeOk(arg ListStoragesRespo return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setListStoragesResponseGetStorageRangeAttributeType(arg *ListStoragesResponseGetStorageRangeAttributeType, val ListStoragesResponseGetStorageRangeRetType) { *arg = &val } // ListStoragesResponse struct for ListStoragesResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListStoragesResponse struct { StorageClasses ListStoragesResponseGetStorageClassesAttributeType `json:"storageClasses,omitempty"` StorageRange ListStoragesResponseGetStorageRangeAttributeType `json:"storageRange,omitempty"` @@ -67,6 +83,7 @@ type ListStoragesResponse 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 NewListStoragesResponse() *ListStoragesResponse { this := ListStoragesResponse{} return &this @@ -75,12 +92,14 @@ func NewListStoragesResponse() *ListStoragesResponse { // NewListStoragesResponseWithDefaults instantiates a new ListStoragesResponse object // This 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 NewListStoragesResponseWithDefaults() *ListStoragesResponse { this := ListStoragesResponse{} return &this } // GetStorageClasses returns the StorageClasses field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListStoragesResponse) GetStorageClasses() (res ListStoragesResponseGetStorageClassesRetType) { res, _ = o.GetStorageClassesOk() return @@ -88,22 +107,26 @@ func (o *ListStoragesResponse) GetStorageClasses() (res ListStoragesResponseGetS // GetStorageClassesOk returns a tuple with the StorageClasses field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListStoragesResponse) GetStorageClassesOk() (ret ListStoragesResponseGetStorageClassesRetType, ok bool) { return getListStoragesResponseGetStorageClassesAttributeTypeOk(o.StorageClasses) } // HasStorageClasses returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListStoragesResponse) HasStorageClasses() bool { _, ok := o.GetStorageClassesOk() return ok } // SetStorageClasses gets a reference to the given []string and assigns it to the StorageClasses field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListStoragesResponse) SetStorageClasses(v ListStoragesResponseGetStorageClassesRetType) { setListStoragesResponseGetStorageClassesAttributeType(&o.StorageClasses, v) } // GetStorageRange returns the StorageRange field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListStoragesResponse) GetStorageRange() (res ListStoragesResponseGetStorageRangeRetType) { res, _ = o.GetStorageRangeOk() return @@ -111,21 +134,25 @@ func (o *ListStoragesResponse) GetStorageRange() (res ListStoragesResponseGetSto // GetStorageRangeOk returns a tuple with the StorageRange field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListStoragesResponse) GetStorageRangeOk() (ret ListStoragesResponseGetStorageRangeRetType, ok bool) { return getListStoragesResponseGetStorageRangeAttributeTypeOk(o.StorageRange) } // HasStorageRange returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListStoragesResponse) HasStorageRange() bool { _, ok := o.GetStorageRangeOk() return ok } // SetStorageRange gets a reference to the given StorageRange and assigns it to the StorageRange field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListStoragesResponse) SetStorageRange(v ListStoragesResponseGetStorageRangeRetType) { setListStoragesResponseGetStorageRangeAttributeType(&o.StorageRange, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ListStoragesResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getListStoragesResponseGetStorageClassesAttributeTypeOk(o.StorageClasses); ok { @@ -137,37 +164,45 @@ func (o ListStoragesResponse) 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 NullableListStoragesResponse struct { value *ListStoragesResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableListStoragesResponse) Get() *ListStoragesResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableListStoragesResponse) Set(val *ListStoragesResponse) { 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 NullableListStoragesResponse) 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 *NullableListStoragesResponse) 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 NewNullableListStoragesResponse(val *ListStoragesResponse) *NullableListStoragesResponse { return &NullableListStoragesResponse{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 NullableListStoragesResponse) 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 *NullableListStoragesResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_list_users_response.go b/services/postgresflex/model_list_users_response.go index c9b934c87..dcc5865d8 100644 --- a/services/postgresflex/model_list_users_response.go +++ b/services/postgresflex/model_list_users_response.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ListUsersResponse{} */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListUsersResponseGetCountAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListUsersResponseGetCountArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListUsersResponseGetCountRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getListUsersResponseGetCountAttributeTypeOk(arg ListUsersResponseGetCountAttributeType) (ret ListUsersResponseGetCountRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getListUsersResponseGetCountAttributeTypeOk(arg ListUsersResponseGetCountAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setListUsersResponseGetCountAttributeType(arg *ListUsersResponseGetCountAttributeType, val ListUsersResponseGetCountRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setListUsersResponseGetCountAttributeType(arg *ListUsersResponseGetCountAtt */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListUsersResponseGetItemsAttributeType = *[]ListUsersResponseItem + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListUsersResponseGetItemsArgType = []ListUsersResponseItem + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListUsersResponseGetItemsRetType = []ListUsersResponseItem +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getListUsersResponseGetItemsAttributeTypeOk(arg ListUsersResponseGetItemsAttributeType) (ret ListUsersResponseGetItemsRetType, ok bool) { if arg == nil { return ret, false @@ -53,11 +67,13 @@ func getListUsersResponseGetItemsAttributeTypeOk(arg ListUsersResponseGetItemsAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setListUsersResponseGetItemsAttributeType(arg *ListUsersResponseGetItemsAttributeType, val ListUsersResponseGetItemsRetType) { *arg = &val } // ListUsersResponse struct for ListUsersResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListUsersResponse struct { Count ListUsersResponseGetCountAttributeType `json:"count,omitempty"` Items ListUsersResponseGetItemsAttributeType `json:"items,omitempty"` @@ -67,6 +83,7 @@ type ListUsersResponse 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 NewListUsersResponse() *ListUsersResponse { this := ListUsersResponse{} return &this @@ -75,12 +92,14 @@ func NewListUsersResponse() *ListUsersResponse { // NewListUsersResponseWithDefaults instantiates a new ListUsersResponse object // This 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 NewListUsersResponseWithDefaults() *ListUsersResponse { this := ListUsersResponse{} return &this } // GetCount returns the Count field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListUsersResponse) GetCount() (res ListUsersResponseGetCountRetType) { res, _ = o.GetCountOk() return @@ -88,22 +107,26 @@ func (o *ListUsersResponse) GetCount() (res ListUsersResponseGetCountRetType) { // GetCountOk returns a tuple with the Count field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListUsersResponse) GetCountOk() (ret ListUsersResponseGetCountRetType, ok bool) { return getListUsersResponseGetCountAttributeTypeOk(o.Count) } // HasCount returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListUsersResponse) HasCount() bool { _, ok := o.GetCountOk() return ok } // SetCount gets a reference to the given int64 and assigns it to the Count field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListUsersResponse) SetCount(v ListUsersResponseGetCountRetType) { setListUsersResponseGetCountAttributeType(&o.Count, v) } // GetItems returns the Items field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListUsersResponse) GetItems() (res ListUsersResponseGetItemsRetType) { res, _ = o.GetItemsOk() return @@ -111,21 +134,25 @@ func (o *ListUsersResponse) GetItems() (res ListUsersResponseGetItemsRetType) { // GetItemsOk returns a tuple with the Items field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListUsersResponse) GetItemsOk() (ret ListUsersResponseGetItemsRetType, ok bool) { return getListUsersResponseGetItemsAttributeTypeOk(o.Items) } // HasItems returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListUsersResponse) HasItems() bool { _, ok := o.GetItemsOk() return ok } // SetItems gets a reference to the given []ListUsersResponseItem and assigns it to the Items field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListUsersResponse) SetItems(v ListUsersResponseGetItemsRetType) { setListUsersResponseGetItemsAttributeType(&o.Items, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ListUsersResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getListUsersResponseGetCountAttributeTypeOk(o.Count); ok { @@ -137,37 +164,45 @@ func (o ListUsersResponse) 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 NullableListUsersResponse struct { value *ListUsersResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableListUsersResponse) Get() *ListUsersResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableListUsersResponse) Set(val *ListUsersResponse) { 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 NullableListUsersResponse) 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 *NullableListUsersResponse) 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 NewNullableListUsersResponse(val *ListUsersResponse) *NullableListUsersResponse { return &NullableListUsersResponse{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 NullableListUsersResponse) 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 *NullableListUsersResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_list_users_response_item.go b/services/postgresflex/model_list_users_response_item.go index f43274641..57dcc0292 100644 --- a/services/postgresflex/model_list_users_response_item.go +++ b/services/postgresflex/model_list_users_response_item.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &ListUsersResponseItem{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListUsersResponseItemGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getListUsersResponseItemGetIdAttributeTypeOk(arg ListUsersResponseItemGetIdAttributeType) (ret ListUsersResponseItemGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getListUsersResponseItemGetIdAttributeTypeOk(arg ListUsersResponseItemGetId return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setListUsersResponseItemGetIdAttributeType(arg *ListUsersResponseItemGetIdAttributeType, val ListUsersResponseItemGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListUsersResponseItemGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListUsersResponseItemGetIdRetType = string /* @@ -43,8 +50,10 @@ type ListUsersResponseItemGetIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListUsersResponseItemGetUsernameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getListUsersResponseItemGetUsernameAttributeTypeOk(arg ListUsersResponseItemGetUsernameAttributeType) (ret ListUsersResponseItemGetUsernameRetType, ok bool) { if arg == nil { return ret, false @@ -52,14 +61,19 @@ func getListUsersResponseItemGetUsernameAttributeTypeOk(arg ListUsersResponseIte return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setListUsersResponseItemGetUsernameAttributeType(arg *ListUsersResponseItemGetUsernameAttributeType, val ListUsersResponseItemGetUsernameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListUsersResponseItemGetUsernameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListUsersResponseItemGetUsernameRetType = string // ListUsersResponseItem struct for ListUsersResponseItem +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListUsersResponseItem struct { Id ListUsersResponseItemGetIdAttributeType `json:"id,omitempty"` Username ListUsersResponseItemGetUsernameAttributeType `json:"username,omitempty"` @@ -69,6 +83,7 @@ type ListUsersResponseItem 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 NewListUsersResponseItem() *ListUsersResponseItem { this := ListUsersResponseItem{} return &this @@ -77,12 +92,14 @@ func NewListUsersResponseItem() *ListUsersResponseItem { // NewListUsersResponseItemWithDefaults instantiates a new ListUsersResponseItem object // This 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 NewListUsersResponseItemWithDefaults() *ListUsersResponseItem { this := ListUsersResponseItem{} 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 *ListUsersResponseItem) GetId() (res ListUsersResponseItemGetIdRetType) { res, _ = o.GetIdOk() return @@ -90,22 +107,26 @@ func (o *ListUsersResponseItem) GetId() (res ListUsersResponseItemGetIdRetType) // 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 *ListUsersResponseItem) GetIdOk() (ret ListUsersResponseItemGetIdRetType, ok bool) { return getListUsersResponseItemGetIdAttributeTypeOk(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 *ListUsersResponseItem) 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 *ListUsersResponseItem) SetId(v ListUsersResponseItemGetIdRetType) { setListUsersResponseItemGetIdAttributeType(&o.Id, v) } // GetUsername returns the Username field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListUsersResponseItem) GetUsername() (res ListUsersResponseItemGetUsernameRetType) { res, _ = o.GetUsernameOk() return @@ -113,21 +134,25 @@ func (o *ListUsersResponseItem) GetUsername() (res ListUsersResponseItemGetUsern // GetUsernameOk returns a tuple with the Username field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListUsersResponseItem) GetUsernameOk() (ret ListUsersResponseItemGetUsernameRetType, ok bool) { return getListUsersResponseItemGetUsernameAttributeTypeOk(o.Username) } // HasUsername returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListUsersResponseItem) HasUsername() bool { _, ok := o.GetUsernameOk() return ok } // SetUsername gets a reference to the given string and assigns it to the Username field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListUsersResponseItem) SetUsername(v ListUsersResponseItemGetUsernameRetType) { setListUsersResponseItemGetUsernameAttributeType(&o.Username, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ListUsersResponseItem) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getListUsersResponseItemGetIdAttributeTypeOk(o.Id); ok { @@ -139,37 +164,45 @@ func (o ListUsersResponseItem) 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 NullableListUsersResponseItem struct { value *ListUsersResponseItem isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableListUsersResponseItem) Get() *ListUsersResponseItem { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableListUsersResponseItem) Set(val *ListUsersResponseItem) { 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 NullableListUsersResponseItem) 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 *NullableListUsersResponseItem) 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 NewNullableListUsersResponseItem(val *ListUsersResponseItem) *NullableListUsersResponseItem { return &NullableListUsersResponseItem{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 NullableListUsersResponseItem) 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 *NullableListUsersResponseItem) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_list_versions_response.go b/services/postgresflex/model_list_versions_response.go index 83a01701c..f8e741aeb 100644 --- a/services/postgresflex/model_list_versions_response.go +++ b/services/postgresflex/model_list_versions_response.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ListVersionsResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListVersionsResponseGetVersionsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListVersionsResponseGetVersionsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListVersionsResponseGetVersionsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getListVersionsResponseGetVersionsAttributeTypeOk(arg ListVersionsResponseGetVersionsAttributeType) (ret ListVersionsResponseGetVersionsRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getListVersionsResponseGetVersionsAttributeTypeOk(arg ListVersionsResponseG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setListVersionsResponseGetVersionsAttributeType(arg *ListVersionsResponseGetVersionsAttributeType, val ListVersionsResponseGetVersionsRetType) { *arg = &val } // ListVersionsResponse struct for ListVersionsResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListVersionsResponse struct { Versions ListVersionsResponseGetVersionsAttributeType `json:"versions,omitempty"` } @@ -46,6 +55,7 @@ type ListVersionsResponse 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 NewListVersionsResponse() *ListVersionsResponse { this := ListVersionsResponse{} return &this @@ -54,12 +64,14 @@ func NewListVersionsResponse() *ListVersionsResponse { // NewListVersionsResponseWithDefaults instantiates a new ListVersionsResponse object // This 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 NewListVersionsResponseWithDefaults() *ListVersionsResponse { this := ListVersionsResponse{} return &this } // GetVersions returns the Versions field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListVersionsResponse) GetVersions() (res ListVersionsResponseGetVersionsRetType) { res, _ = o.GetVersionsOk() return @@ -67,21 +79,25 @@ func (o *ListVersionsResponse) GetVersions() (res ListVersionsResponseGetVersion // GetVersionsOk returns a tuple with the Versions field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListVersionsResponse) GetVersionsOk() (ret ListVersionsResponseGetVersionsRetType, ok bool) { return getListVersionsResponseGetVersionsAttributeTypeOk(o.Versions) } // HasVersions returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListVersionsResponse) HasVersions() bool { _, ok := o.GetVersionsOk() return ok } // SetVersions gets a reference to the given []string and assigns it to the Versions field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListVersionsResponse) SetVersions(v ListVersionsResponseGetVersionsRetType) { setListVersionsResponseGetVersionsAttributeType(&o.Versions, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ListVersionsResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getListVersionsResponseGetVersionsAttributeTypeOk(o.Versions); ok { @@ -90,37 +106,45 @@ func (o ListVersionsResponse) 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 NullableListVersionsResponse struct { value *ListVersionsResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableListVersionsResponse) Get() *ListVersionsResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableListVersionsResponse) Set(val *ListVersionsResponse) { 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 NullableListVersionsResponse) 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 *NullableListVersionsResponse) 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 NewNullableListVersionsResponse(val *ListVersionsResponse) *NullableListVersionsResponse { return &NullableListVersionsResponse{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 NullableListVersionsResponse) 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 *NullableListVersionsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_partial_update_instance_payload.go b/services/postgresflex/model_partial_update_instance_payload.go index 03cdb4b8c..c80f5e51e 100644 --- a/services/postgresflex/model_partial_update_instance_payload.go +++ b/services/postgresflex/model_partial_update_instance_payload.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &PartialUpdateInstancePayload{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateInstancePayloadGetAclAttributeType = *ACL + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateInstancePayloadGetAclArgType = ACL + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateInstancePayloadGetAclRetType = ACL +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPartialUpdateInstancePayloadGetAclAttributeTypeOk(arg PartialUpdateInstancePayloadGetAclAttributeType) (ret PartialUpdateInstancePayloadGetAclRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getPartialUpdateInstancePayloadGetAclAttributeTypeOk(arg PartialUpdateInsta return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPartialUpdateInstancePayloadGetAclAttributeType(arg *PartialUpdateInstancePayloadGetAclAttributeType, val PartialUpdateInstancePayloadGetAclRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setPartialUpdateInstancePayloadGetAclAttributeType(arg *PartialUpdateInstan */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateInstancePayloadGetBackupScheduleAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPartialUpdateInstancePayloadGetBackupScheduleAttributeTypeOk(arg PartialUpdateInstancePayloadGetBackupScheduleAttributeType) (ret PartialUpdateInstancePayloadGetBackupScheduleRetType, ok bool) { if arg == nil { return ret, false @@ -51,11 +61,15 @@ func getPartialUpdateInstancePayloadGetBackupScheduleAttributeTypeOk(arg Partial return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPartialUpdateInstancePayloadGetBackupScheduleAttributeType(arg *PartialUpdateInstancePayloadGetBackupScheduleAttributeType, val PartialUpdateInstancePayloadGetBackupScheduleRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateInstancePayloadGetBackupScheduleArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateInstancePayloadGetBackupScheduleRetType = string /* @@ -63,8 +77,10 @@ type PartialUpdateInstancePayloadGetBackupScheduleRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateInstancePayloadGetFlavorIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPartialUpdateInstancePayloadGetFlavorIdAttributeTypeOk(arg PartialUpdateInstancePayloadGetFlavorIdAttributeType) (ret PartialUpdateInstancePayloadGetFlavorIdRetType, ok bool) { if arg == nil { return ret, false @@ -72,11 +88,15 @@ func getPartialUpdateInstancePayloadGetFlavorIdAttributeTypeOk(arg PartialUpdate return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPartialUpdateInstancePayloadGetFlavorIdAttributeType(arg *PartialUpdateInstancePayloadGetFlavorIdAttributeType, val PartialUpdateInstancePayloadGetFlavorIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateInstancePayloadGetFlavorIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateInstancePayloadGetFlavorIdRetType = string /* @@ -84,10 +104,16 @@ type PartialUpdateInstancePayloadGetFlavorIdRetType = string */ // isContainer +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateInstancePayloadGetLabelsAttributeType = *map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateInstancePayloadGetLabelsArgType = map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateInstancePayloadGetLabelsRetType = map[string]string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPartialUpdateInstancePayloadGetLabelsAttributeTypeOk(arg PartialUpdateInstancePayloadGetLabelsAttributeType) (ret PartialUpdateInstancePayloadGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -95,6 +121,7 @@ func getPartialUpdateInstancePayloadGetLabelsAttributeTypeOk(arg PartialUpdateIn return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPartialUpdateInstancePayloadGetLabelsAttributeType(arg *PartialUpdateInstancePayloadGetLabelsAttributeType, val PartialUpdateInstancePayloadGetLabelsRetType) { *arg = &val } @@ -104,8 +131,10 @@ func setPartialUpdateInstancePayloadGetLabelsAttributeType(arg *PartialUpdateIns */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateInstancePayloadGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPartialUpdateInstancePayloadGetNameAttributeTypeOk(arg PartialUpdateInstancePayloadGetNameAttributeType) (ret PartialUpdateInstancePayloadGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -113,11 +142,15 @@ func getPartialUpdateInstancePayloadGetNameAttributeTypeOk(arg PartialUpdateInst return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPartialUpdateInstancePayloadGetNameAttributeType(arg *PartialUpdateInstancePayloadGetNameAttributeType, val PartialUpdateInstancePayloadGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateInstancePayloadGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateInstancePayloadGetNameRetType = string /* @@ -125,10 +158,16 @@ type PartialUpdateInstancePayloadGetNameRetType = string */ // isContainer +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateInstancePayloadGetOptionsAttributeType = *map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateInstancePayloadGetOptionsArgType = map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateInstancePayloadGetOptionsRetType = map[string]string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPartialUpdateInstancePayloadGetOptionsAttributeTypeOk(arg PartialUpdateInstancePayloadGetOptionsAttributeType) (ret PartialUpdateInstancePayloadGetOptionsRetType, ok bool) { if arg == nil { return ret, false @@ -136,6 +175,7 @@ func getPartialUpdateInstancePayloadGetOptionsAttributeTypeOk(arg PartialUpdateI return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPartialUpdateInstancePayloadGetOptionsAttributeType(arg *PartialUpdateInstancePayloadGetOptionsAttributeType, val PartialUpdateInstancePayloadGetOptionsRetType) { *arg = &val } @@ -145,10 +185,16 @@ func setPartialUpdateInstancePayloadGetOptionsAttributeType(arg *PartialUpdateIn */ // isInteger +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateInstancePayloadGetReplicasAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateInstancePayloadGetReplicasArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateInstancePayloadGetReplicasRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPartialUpdateInstancePayloadGetReplicasAttributeTypeOk(arg PartialUpdateInstancePayloadGetReplicasAttributeType) (ret PartialUpdateInstancePayloadGetReplicasRetType, ok bool) { if arg == nil { return ret, false @@ -156,6 +202,7 @@ func getPartialUpdateInstancePayloadGetReplicasAttributeTypeOk(arg PartialUpdate return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPartialUpdateInstancePayloadGetReplicasAttributeType(arg *PartialUpdateInstancePayloadGetReplicasAttributeType, val PartialUpdateInstancePayloadGetReplicasRetType) { *arg = &val } @@ -165,10 +212,16 @@ func setPartialUpdateInstancePayloadGetReplicasAttributeType(arg *PartialUpdateI */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateInstancePayloadGetStorageAttributeType = *StorageUpdate + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateInstancePayloadGetStorageArgType = StorageUpdate + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateInstancePayloadGetStorageRetType = StorageUpdate +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPartialUpdateInstancePayloadGetStorageAttributeTypeOk(arg PartialUpdateInstancePayloadGetStorageAttributeType) (ret PartialUpdateInstancePayloadGetStorageRetType, ok bool) { if arg == nil { return ret, false @@ -176,6 +229,7 @@ func getPartialUpdateInstancePayloadGetStorageAttributeTypeOk(arg PartialUpdateI return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPartialUpdateInstancePayloadGetStorageAttributeType(arg *PartialUpdateInstancePayloadGetStorageAttributeType, val PartialUpdateInstancePayloadGetStorageRetType) { *arg = &val } @@ -185,8 +239,10 @@ func setPartialUpdateInstancePayloadGetStorageAttributeType(arg *PartialUpdateIn */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateInstancePayloadGetVersionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPartialUpdateInstancePayloadGetVersionAttributeTypeOk(arg PartialUpdateInstancePayloadGetVersionAttributeType) (ret PartialUpdateInstancePayloadGetVersionRetType, ok bool) { if arg == nil { return ret, false @@ -194,14 +250,19 @@ func getPartialUpdateInstancePayloadGetVersionAttributeTypeOk(arg PartialUpdateI return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPartialUpdateInstancePayloadGetVersionAttributeType(arg *PartialUpdateInstancePayloadGetVersionAttributeType, val PartialUpdateInstancePayloadGetVersionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateInstancePayloadGetVersionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateInstancePayloadGetVersionRetType = string // PartialUpdateInstancePayload struct for PartialUpdateInstancePayload +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateInstancePayload struct { Acl PartialUpdateInstancePayloadGetAclAttributeType `json:"acl,omitempty"` BackupSchedule PartialUpdateInstancePayloadGetBackupScheduleAttributeType `json:"backupSchedule,omitempty"` @@ -220,6 +281,7 @@ type PartialUpdateInstancePayload 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 NewPartialUpdateInstancePayload() *PartialUpdateInstancePayload { this := PartialUpdateInstancePayload{} return &this @@ -228,12 +290,14 @@ func NewPartialUpdateInstancePayload() *PartialUpdateInstancePayload { // NewPartialUpdateInstancePayloadWithDefaults instantiates a new PartialUpdateInstancePayload object // This 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 NewPartialUpdateInstancePayloadWithDefaults() *PartialUpdateInstancePayload { this := PartialUpdateInstancePayload{} return &this } // GetAcl returns the Acl field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateInstancePayload) GetAcl() (res PartialUpdateInstancePayloadGetAclRetType) { res, _ = o.GetAclOk() return @@ -241,22 +305,26 @@ func (o *PartialUpdateInstancePayload) GetAcl() (res PartialUpdateInstancePayloa // GetAclOk returns a tuple with the Acl field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateInstancePayload) GetAclOk() (ret PartialUpdateInstancePayloadGetAclRetType, ok bool) { return getPartialUpdateInstancePayloadGetAclAttributeTypeOk(o.Acl) } // HasAcl returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateInstancePayload) HasAcl() bool { _, ok := o.GetAclOk() return ok } // SetAcl gets a reference to the given ACL and assigns it to the Acl field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateInstancePayload) SetAcl(v PartialUpdateInstancePayloadGetAclRetType) { setPartialUpdateInstancePayloadGetAclAttributeType(&o.Acl, v) } // GetBackupSchedule returns the BackupSchedule field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateInstancePayload) GetBackupSchedule() (res PartialUpdateInstancePayloadGetBackupScheduleRetType) { res, _ = o.GetBackupScheduleOk() return @@ -264,22 +332,26 @@ func (o *PartialUpdateInstancePayload) GetBackupSchedule() (res PartialUpdateIns // GetBackupScheduleOk returns a tuple with the BackupSchedule field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateInstancePayload) GetBackupScheduleOk() (ret PartialUpdateInstancePayloadGetBackupScheduleRetType, ok bool) { return getPartialUpdateInstancePayloadGetBackupScheduleAttributeTypeOk(o.BackupSchedule) } // HasBackupSchedule returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateInstancePayload) HasBackupSchedule() bool { _, ok := o.GetBackupScheduleOk() return ok } // SetBackupSchedule gets a reference to the given string and assigns it to the BackupSchedule field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateInstancePayload) SetBackupSchedule(v PartialUpdateInstancePayloadGetBackupScheduleRetType) { setPartialUpdateInstancePayloadGetBackupScheduleAttributeType(&o.BackupSchedule, v) } // GetFlavorId returns the FlavorId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateInstancePayload) GetFlavorId() (res PartialUpdateInstancePayloadGetFlavorIdRetType) { res, _ = o.GetFlavorIdOk() return @@ -287,22 +359,26 @@ func (o *PartialUpdateInstancePayload) GetFlavorId() (res PartialUpdateInstanceP // GetFlavorIdOk returns a tuple with the FlavorId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateInstancePayload) GetFlavorIdOk() (ret PartialUpdateInstancePayloadGetFlavorIdRetType, ok bool) { return getPartialUpdateInstancePayloadGetFlavorIdAttributeTypeOk(o.FlavorId) } // HasFlavorId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateInstancePayload) HasFlavorId() bool { _, ok := o.GetFlavorIdOk() return ok } // SetFlavorId gets a reference to the given string and assigns it to the FlavorId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateInstancePayload) SetFlavorId(v PartialUpdateInstancePayloadGetFlavorIdRetType) { setPartialUpdateInstancePayloadGetFlavorIdAttributeType(&o.FlavorId, 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 *PartialUpdateInstancePayload) GetLabels() (res PartialUpdateInstancePayloadGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -310,22 +386,26 @@ func (o *PartialUpdateInstancePayload) GetLabels() (res PartialUpdateInstancePay // 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 *PartialUpdateInstancePayload) GetLabelsOk() (ret PartialUpdateInstancePayloadGetLabelsRetType, ok bool) { return getPartialUpdateInstancePayloadGetLabelsAttributeTypeOk(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 *PartialUpdateInstancePayload) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]string 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 *PartialUpdateInstancePayload) SetLabels(v PartialUpdateInstancePayloadGetLabelsRetType) { setPartialUpdateInstancePayloadGetLabelsAttributeType(&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 *PartialUpdateInstancePayload) GetName() (res PartialUpdateInstancePayloadGetNameRetType) { res, _ = o.GetNameOk() return @@ -333,22 +413,26 @@ func (o *PartialUpdateInstancePayload) GetName() (res PartialUpdateInstancePaylo // 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 *PartialUpdateInstancePayload) GetNameOk() (ret PartialUpdateInstancePayloadGetNameRetType, ok bool) { return getPartialUpdateInstancePayloadGetNameAttributeTypeOk(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 *PartialUpdateInstancePayload) 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 *PartialUpdateInstancePayload) SetName(v PartialUpdateInstancePayloadGetNameRetType) { setPartialUpdateInstancePayloadGetNameAttributeType(&o.Name, v) } // GetOptions returns the Options field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateInstancePayload) GetOptions() (res PartialUpdateInstancePayloadGetOptionsRetType) { res, _ = o.GetOptionsOk() return @@ -356,22 +440,26 @@ func (o *PartialUpdateInstancePayload) GetOptions() (res PartialUpdateInstancePa // GetOptionsOk returns a tuple with the Options field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateInstancePayload) GetOptionsOk() (ret PartialUpdateInstancePayloadGetOptionsRetType, ok bool) { return getPartialUpdateInstancePayloadGetOptionsAttributeTypeOk(o.Options) } // HasOptions returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateInstancePayload) HasOptions() bool { _, ok := o.GetOptionsOk() return ok } // SetOptions gets a reference to the given map[string]string and assigns it to the Options field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateInstancePayload) SetOptions(v PartialUpdateInstancePayloadGetOptionsRetType) { setPartialUpdateInstancePayloadGetOptionsAttributeType(&o.Options, v) } // GetReplicas returns the Replicas field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateInstancePayload) GetReplicas() (res PartialUpdateInstancePayloadGetReplicasRetType) { res, _ = o.GetReplicasOk() return @@ -379,22 +467,26 @@ func (o *PartialUpdateInstancePayload) GetReplicas() (res PartialUpdateInstanceP // GetReplicasOk returns a tuple with the Replicas field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateInstancePayload) GetReplicasOk() (ret PartialUpdateInstancePayloadGetReplicasRetType, ok bool) { return getPartialUpdateInstancePayloadGetReplicasAttributeTypeOk(o.Replicas) } // HasReplicas returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateInstancePayload) HasReplicas() bool { _, ok := o.GetReplicasOk() return ok } // SetReplicas gets a reference to the given int64 and assigns it to the Replicas field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateInstancePayload) SetReplicas(v PartialUpdateInstancePayloadGetReplicasRetType) { setPartialUpdateInstancePayloadGetReplicasAttributeType(&o.Replicas, v) } // GetStorage returns the Storage field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateInstancePayload) GetStorage() (res PartialUpdateInstancePayloadGetStorageRetType) { res, _ = o.GetStorageOk() return @@ -402,22 +494,26 @@ func (o *PartialUpdateInstancePayload) GetStorage() (res PartialUpdateInstancePa // GetStorageOk returns a tuple with the Storage field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateInstancePayload) GetStorageOk() (ret PartialUpdateInstancePayloadGetStorageRetType, ok bool) { return getPartialUpdateInstancePayloadGetStorageAttributeTypeOk(o.Storage) } // HasStorage returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateInstancePayload) HasStorage() bool { _, ok := o.GetStorageOk() return ok } // SetStorage gets a reference to the given StorageUpdate and assigns it to the Storage field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateInstancePayload) SetStorage(v PartialUpdateInstancePayloadGetStorageRetType) { setPartialUpdateInstancePayloadGetStorageAttributeType(&o.Storage, v) } // GetVersion returns the Version field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateInstancePayload) GetVersion() (res PartialUpdateInstancePayloadGetVersionRetType) { res, _ = o.GetVersionOk() return @@ -425,21 +521,25 @@ func (o *PartialUpdateInstancePayload) GetVersion() (res PartialUpdateInstancePa // GetVersionOk returns a tuple with the Version field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateInstancePayload) GetVersionOk() (ret PartialUpdateInstancePayloadGetVersionRetType, ok bool) { return getPartialUpdateInstancePayloadGetVersionAttributeTypeOk(o.Version) } // HasVersion returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateInstancePayload) HasVersion() bool { _, ok := o.GetVersionOk() return ok } // SetVersion gets a reference to the given string and assigns it to the Version field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateInstancePayload) SetVersion(v PartialUpdateInstancePayloadGetVersionRetType) { setPartialUpdateInstancePayloadGetVersionAttributeType(&o.Version, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o PartialUpdateInstancePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getPartialUpdateInstancePayloadGetAclAttributeTypeOk(o.Acl); ok { @@ -472,37 +572,45 @@ func (o PartialUpdateInstancePayload) 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 NullablePartialUpdateInstancePayload struct { value *PartialUpdateInstancePayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePartialUpdateInstancePayload) Get() *PartialUpdateInstancePayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePartialUpdateInstancePayload) Set(val *PartialUpdateInstancePayload) { 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 NullablePartialUpdateInstancePayload) 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 *NullablePartialUpdateInstancePayload) 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 NewNullablePartialUpdateInstancePayload(val *PartialUpdateInstancePayload) *NullablePartialUpdateInstancePayload { return &NullablePartialUpdateInstancePayload{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 NullablePartialUpdateInstancePayload) 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 *NullablePartialUpdateInstancePayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_partial_update_instance_response.go b/services/postgresflex/model_partial_update_instance_response.go index 74e90e25e..820e1f5e0 100644 --- a/services/postgresflex/model_partial_update_instance_response.go +++ b/services/postgresflex/model_partial_update_instance_response.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &PartialUpdateInstanceResponse{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateInstanceResponseGetItemAttributeType = *Instance + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateInstanceResponseGetItemArgType = Instance + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateInstanceResponseGetItemRetType = Instance +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPartialUpdateInstanceResponseGetItemAttributeTypeOk(arg PartialUpdateInstanceResponseGetItemAttributeType) (ret PartialUpdateInstanceResponseGetItemRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getPartialUpdateInstanceResponseGetItemAttributeTypeOk(arg PartialUpdateIns return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPartialUpdateInstanceResponseGetItemAttributeType(arg *PartialUpdateInstanceResponseGetItemAttributeType, val PartialUpdateInstanceResponseGetItemRetType) { *arg = &val } // PartialUpdateInstanceResponse struct for PartialUpdateInstanceResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateInstanceResponse struct { Item PartialUpdateInstanceResponseGetItemAttributeType `json:"item,omitempty"` } @@ -46,6 +55,7 @@ type PartialUpdateInstanceResponse 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 NewPartialUpdateInstanceResponse() *PartialUpdateInstanceResponse { this := PartialUpdateInstanceResponse{} return &this @@ -54,12 +64,14 @@ func NewPartialUpdateInstanceResponse() *PartialUpdateInstanceResponse { // NewPartialUpdateInstanceResponseWithDefaults instantiates a new PartialUpdateInstanceResponse object // This 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 NewPartialUpdateInstanceResponseWithDefaults() *PartialUpdateInstanceResponse { this := PartialUpdateInstanceResponse{} return &this } // GetItem returns the Item field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateInstanceResponse) GetItem() (res PartialUpdateInstanceResponseGetItemRetType) { res, _ = o.GetItemOk() return @@ -67,21 +79,25 @@ func (o *PartialUpdateInstanceResponse) GetItem() (res PartialUpdateInstanceResp // GetItemOk returns a tuple with the Item field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateInstanceResponse) GetItemOk() (ret PartialUpdateInstanceResponseGetItemRetType, ok bool) { return getPartialUpdateInstanceResponseGetItemAttributeTypeOk(o.Item) } // HasItem returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateInstanceResponse) HasItem() bool { _, ok := o.GetItemOk() return ok } // SetItem gets a reference to the given Instance and assigns it to the Item field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateInstanceResponse) SetItem(v PartialUpdateInstanceResponseGetItemRetType) { setPartialUpdateInstanceResponseGetItemAttributeType(&o.Item, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o PartialUpdateInstanceResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getPartialUpdateInstanceResponseGetItemAttributeTypeOk(o.Item); ok { @@ -90,37 +106,45 @@ func (o PartialUpdateInstanceResponse) 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 NullablePartialUpdateInstanceResponse struct { value *PartialUpdateInstanceResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePartialUpdateInstanceResponse) Get() *PartialUpdateInstanceResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePartialUpdateInstanceResponse) Set(val *PartialUpdateInstanceResponse) { 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 NullablePartialUpdateInstanceResponse) 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 *NullablePartialUpdateInstanceResponse) 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 NewNullablePartialUpdateInstanceResponse(val *PartialUpdateInstanceResponse) *NullablePartialUpdateInstanceResponse { return &NullablePartialUpdateInstanceResponse{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 NullablePartialUpdateInstanceResponse) 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 *NullablePartialUpdateInstanceResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_partial_update_user_payload.go b/services/postgresflex/model_partial_update_user_payload.go index a6c0ba631..fee074c9e 100644 --- a/services/postgresflex/model_partial_update_user_payload.go +++ b/services/postgresflex/model_partial_update_user_payload.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &PartialUpdateUserPayload{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateUserPayloadGetDatabaseAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPartialUpdateUserPayloadGetDatabaseAttributeTypeOk(arg PartialUpdateUserPayloadGetDatabaseAttributeType) (ret PartialUpdateUserPayloadGetDatabaseRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getPartialUpdateUserPayloadGetDatabaseAttributeTypeOk(arg PartialUpdateUser return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPartialUpdateUserPayloadGetDatabaseAttributeType(arg *PartialUpdateUserPayloadGetDatabaseAttributeType, val PartialUpdateUserPayloadGetDatabaseRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateUserPayloadGetDatabaseArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateUserPayloadGetDatabaseRetType = string /* @@ -43,10 +50,16 @@ type PartialUpdateUserPayloadGetDatabaseRetType = string */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateUserPayloadGetRolesAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateUserPayloadGetRolesArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateUserPayloadGetRolesRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPartialUpdateUserPayloadGetRolesAttributeTypeOk(arg PartialUpdateUserPayloadGetRolesAttributeType) (ret PartialUpdateUserPayloadGetRolesRetType, ok bool) { if arg == nil { return ret, false @@ -54,11 +67,13 @@ func getPartialUpdateUserPayloadGetRolesAttributeTypeOk(arg PartialUpdateUserPay return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPartialUpdateUserPayloadGetRolesAttributeType(arg *PartialUpdateUserPayloadGetRolesAttributeType, val PartialUpdateUserPayloadGetRolesRetType) { *arg = &val } // PartialUpdateUserPayload struct for PartialUpdateUserPayload +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateUserPayload struct { Database PartialUpdateUserPayloadGetDatabaseAttributeType `json:"database,omitempty"` Roles PartialUpdateUserPayloadGetRolesAttributeType `json:"roles,omitempty"` @@ -68,6 +83,7 @@ type PartialUpdateUserPayload 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 NewPartialUpdateUserPayload() *PartialUpdateUserPayload { this := PartialUpdateUserPayload{} return &this @@ -76,12 +92,14 @@ func NewPartialUpdateUserPayload() *PartialUpdateUserPayload { // NewPartialUpdateUserPayloadWithDefaults instantiates a new PartialUpdateUserPayload object // This 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 NewPartialUpdateUserPayloadWithDefaults() *PartialUpdateUserPayload { this := PartialUpdateUserPayload{} return &this } // GetDatabase returns the Database field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateUserPayload) GetDatabase() (res PartialUpdateUserPayloadGetDatabaseRetType) { res, _ = o.GetDatabaseOk() return @@ -89,22 +107,26 @@ func (o *PartialUpdateUserPayload) GetDatabase() (res PartialUpdateUserPayloadGe // GetDatabaseOk returns a tuple with the Database field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateUserPayload) GetDatabaseOk() (ret PartialUpdateUserPayloadGetDatabaseRetType, ok bool) { return getPartialUpdateUserPayloadGetDatabaseAttributeTypeOk(o.Database) } // HasDatabase returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateUserPayload) HasDatabase() bool { _, ok := o.GetDatabaseOk() return ok } // SetDatabase gets a reference to the given string and assigns it to the Database field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateUserPayload) SetDatabase(v PartialUpdateUserPayloadGetDatabaseRetType) { setPartialUpdateUserPayloadGetDatabaseAttributeType(&o.Database, v) } // GetRoles returns the Roles field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateUserPayload) GetRoles() (res PartialUpdateUserPayloadGetRolesRetType) { res, _ = o.GetRolesOk() return @@ -112,21 +134,25 @@ func (o *PartialUpdateUserPayload) GetRoles() (res PartialUpdateUserPayloadGetRo // GetRolesOk returns a tuple with the Roles field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateUserPayload) GetRolesOk() (ret PartialUpdateUserPayloadGetRolesRetType, ok bool) { return getPartialUpdateUserPayloadGetRolesAttributeTypeOk(o.Roles) } // HasRoles returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateUserPayload) HasRoles() bool { _, ok := o.GetRolesOk() return ok } // SetRoles gets a reference to the given []string and assigns it to the Roles field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateUserPayload) SetRoles(v PartialUpdateUserPayloadGetRolesRetType) { setPartialUpdateUserPayloadGetRolesAttributeType(&o.Roles, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o PartialUpdateUserPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getPartialUpdateUserPayloadGetDatabaseAttributeTypeOk(o.Database); ok { @@ -138,37 +164,45 @@ func (o PartialUpdateUserPayload) 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 NullablePartialUpdateUserPayload struct { value *PartialUpdateUserPayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePartialUpdateUserPayload) Get() *PartialUpdateUserPayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePartialUpdateUserPayload) Set(val *PartialUpdateUserPayload) { 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 NullablePartialUpdateUserPayload) 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 *NullablePartialUpdateUserPayload) 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 NewNullablePartialUpdateUserPayload(val *PartialUpdateUserPayload) *NullablePartialUpdateUserPayload { return &NullablePartialUpdateUserPayload{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 NullablePartialUpdateUserPayload) 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 *NullablePartialUpdateUserPayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_postgres_database_parameter.go b/services/postgresflex/model_postgres_database_parameter.go index 623289803..b68e5ab39 100644 --- a/services/postgresflex/model_postgres_database_parameter.go +++ b/services/postgresflex/model_postgres_database_parameter.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &PostgresDatabaseParameter{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParameterGetContextAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPostgresDatabaseParameterGetContextAttributeTypeOk(arg PostgresDatabaseParameterGetContextAttributeType) (ret PostgresDatabaseParameterGetContextRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getPostgresDatabaseParameterGetContextAttributeTypeOk(arg PostgresDatabaseP return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPostgresDatabaseParameterGetContextAttributeType(arg *PostgresDatabaseParameterGetContextAttributeType, val PostgresDatabaseParameterGetContextRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParameterGetContextArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParameterGetContextRetType = string /* @@ -43,8 +50,10 @@ type PostgresDatabaseParameterGetContextRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParameterGetDataTypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPostgresDatabaseParameterGetDataTypeAttributeTypeOk(arg PostgresDatabaseParameterGetDataTypeAttributeType) (ret PostgresDatabaseParameterGetDataTypeRetType, ok bool) { if arg == nil { return ret, false @@ -52,11 +61,15 @@ func getPostgresDatabaseParameterGetDataTypeAttributeTypeOk(arg PostgresDatabase return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPostgresDatabaseParameterGetDataTypeAttributeType(arg *PostgresDatabaseParameterGetDataTypeAttributeType, val PostgresDatabaseParameterGetDataTypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParameterGetDataTypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParameterGetDataTypeRetType = string /* @@ -64,8 +77,10 @@ type PostgresDatabaseParameterGetDataTypeRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParameterGetDefaultValueAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPostgresDatabaseParameterGetDefaultValueAttributeTypeOk(arg PostgresDatabaseParameterGetDefaultValueAttributeType) (ret PostgresDatabaseParameterGetDefaultValueRetType, ok bool) { if arg == nil { return ret, false @@ -73,11 +88,15 @@ func getPostgresDatabaseParameterGetDefaultValueAttributeTypeOk(arg PostgresData return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPostgresDatabaseParameterGetDefaultValueAttributeType(arg *PostgresDatabaseParameterGetDefaultValueAttributeType, val PostgresDatabaseParameterGetDefaultValueRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParameterGetDefaultValueArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParameterGetDefaultValueRetType = string /* @@ -85,8 +104,10 @@ type PostgresDatabaseParameterGetDefaultValueRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParameterGetDescriptionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPostgresDatabaseParameterGetDescriptionAttributeTypeOk(arg PostgresDatabaseParameterGetDescriptionAttributeType) (ret PostgresDatabaseParameterGetDescriptionRetType, ok bool) { if arg == nil { return ret, false @@ -94,11 +115,15 @@ func getPostgresDatabaseParameterGetDescriptionAttributeTypeOk(arg PostgresDatab return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPostgresDatabaseParameterGetDescriptionAttributeType(arg *PostgresDatabaseParameterGetDescriptionAttributeType, val PostgresDatabaseParameterGetDescriptionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParameterGetDescriptionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParameterGetDescriptionRetType = string /* @@ -106,10 +131,16 @@ type PostgresDatabaseParameterGetDescriptionRetType = string */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParametergetEditAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParametergetEditArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParametergetEditRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPostgresDatabaseParametergetEditAttributeTypeOk(arg PostgresDatabaseParametergetEditAttributeType) (ret PostgresDatabaseParametergetEditRetType, ok bool) { if arg == nil { return ret, false @@ -117,6 +148,7 @@ func getPostgresDatabaseParametergetEditAttributeTypeOk(arg PostgresDatabasePara return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPostgresDatabaseParametergetEditAttributeType(arg *PostgresDatabaseParametergetEditAttributeType, val PostgresDatabaseParametergetEditRetType) { *arg = &val } @@ -126,8 +158,10 @@ func setPostgresDatabaseParametergetEditAttributeType(arg *PostgresDatabaseParam */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParameterGetMaxValueAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPostgresDatabaseParameterGetMaxValueAttributeTypeOk(arg PostgresDatabaseParameterGetMaxValueAttributeType) (ret PostgresDatabaseParameterGetMaxValueRetType, ok bool) { if arg == nil { return ret, false @@ -135,11 +169,15 @@ func getPostgresDatabaseParameterGetMaxValueAttributeTypeOk(arg PostgresDatabase return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPostgresDatabaseParameterGetMaxValueAttributeType(arg *PostgresDatabaseParameterGetMaxValueAttributeType, val PostgresDatabaseParameterGetMaxValueRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParameterGetMaxValueArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParameterGetMaxValueRetType = string /* @@ -147,8 +185,10 @@ type PostgresDatabaseParameterGetMaxValueRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParameterGetMinValueAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPostgresDatabaseParameterGetMinValueAttributeTypeOk(arg PostgresDatabaseParameterGetMinValueAttributeType) (ret PostgresDatabaseParameterGetMinValueRetType, ok bool) { if arg == nil { return ret, false @@ -156,11 +196,15 @@ func getPostgresDatabaseParameterGetMinValueAttributeTypeOk(arg PostgresDatabase return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPostgresDatabaseParameterGetMinValueAttributeType(arg *PostgresDatabaseParameterGetMinValueAttributeType, val PostgresDatabaseParameterGetMinValueRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParameterGetMinValueArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParameterGetMinValueRetType = string /* @@ -168,8 +212,10 @@ type PostgresDatabaseParameterGetMinValueRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParameterGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPostgresDatabaseParameterGetNameAttributeTypeOk(arg PostgresDatabaseParameterGetNameAttributeType) (ret PostgresDatabaseParameterGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -177,11 +223,15 @@ func getPostgresDatabaseParameterGetNameAttributeTypeOk(arg PostgresDatabasePara return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPostgresDatabaseParameterGetNameAttributeType(arg *PostgresDatabaseParameterGetNameAttributeType, val PostgresDatabaseParameterGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParameterGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParameterGetNameRetType = string /* @@ -189,10 +239,16 @@ type PostgresDatabaseParameterGetNameRetType = string */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParametergetPendingRestartAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParametergetPendingRestartArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParametergetPendingRestartRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPostgresDatabaseParametergetPendingRestartAttributeTypeOk(arg PostgresDatabaseParametergetPendingRestartAttributeType) (ret PostgresDatabaseParametergetPendingRestartRetType, ok bool) { if arg == nil { return ret, false @@ -200,6 +256,7 @@ func getPostgresDatabaseParametergetPendingRestartAttributeTypeOk(arg PostgresDa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPostgresDatabaseParametergetPendingRestartAttributeType(arg *PostgresDatabaseParametergetPendingRestartAttributeType, val PostgresDatabaseParametergetPendingRestartRetType) { *arg = &val } @@ -209,8 +266,10 @@ func setPostgresDatabaseParametergetPendingRestartAttributeType(arg *PostgresDat */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParameterGetResetValueAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPostgresDatabaseParameterGetResetValueAttributeTypeOk(arg PostgresDatabaseParameterGetResetValueAttributeType) (ret PostgresDatabaseParameterGetResetValueRetType, ok bool) { if arg == nil { return ret, false @@ -218,11 +277,15 @@ func getPostgresDatabaseParameterGetResetValueAttributeTypeOk(arg PostgresDataba return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPostgresDatabaseParameterGetResetValueAttributeType(arg *PostgresDatabaseParameterGetResetValueAttributeType, val PostgresDatabaseParameterGetResetValueRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParameterGetResetValueArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParameterGetResetValueRetType = string /* @@ -230,8 +293,10 @@ type PostgresDatabaseParameterGetResetValueRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParameterGetUnitAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPostgresDatabaseParameterGetUnitAttributeTypeOk(arg PostgresDatabaseParameterGetUnitAttributeType) (ret PostgresDatabaseParameterGetUnitRetType, ok bool) { if arg == nil { return ret, false @@ -239,11 +304,15 @@ func getPostgresDatabaseParameterGetUnitAttributeTypeOk(arg PostgresDatabasePara return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPostgresDatabaseParameterGetUnitAttributeType(arg *PostgresDatabaseParameterGetUnitAttributeType, val PostgresDatabaseParameterGetUnitRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParameterGetUnitArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParameterGetUnitRetType = string /* @@ -251,8 +320,10 @@ type PostgresDatabaseParameterGetUnitRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParameterGetValueAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPostgresDatabaseParameterGetValueAttributeTypeOk(arg PostgresDatabaseParameterGetValueAttributeType) (ret PostgresDatabaseParameterGetValueRetType, ok bool) { if arg == nil { return ret, false @@ -260,14 +331,19 @@ func getPostgresDatabaseParameterGetValueAttributeTypeOk(arg PostgresDatabasePar return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPostgresDatabaseParameterGetValueAttributeType(arg *PostgresDatabaseParameterGetValueAttributeType, val PostgresDatabaseParameterGetValueRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParameterGetValueArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParameterGetValueRetType = string // PostgresDatabaseParameter struct for PostgresDatabaseParameter +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParameter struct { // Context of the parameter. Context PostgresDatabaseParameterGetContextAttributeType `json:"context,omitempty"` @@ -299,6 +375,7 @@ type PostgresDatabaseParameter 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 NewPostgresDatabaseParameter() *PostgresDatabaseParameter { this := PostgresDatabaseParameter{} return &this @@ -307,12 +384,14 @@ func NewPostgresDatabaseParameter() *PostgresDatabaseParameter { // NewPostgresDatabaseParameterWithDefaults instantiates a new PostgresDatabaseParameter object // This 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 NewPostgresDatabaseParameterWithDefaults() *PostgresDatabaseParameter { this := PostgresDatabaseParameter{} return &this } // GetContext returns the Context field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) GetContext() (res PostgresDatabaseParameterGetContextRetType) { res, _ = o.GetContextOk() return @@ -320,22 +399,26 @@ func (o *PostgresDatabaseParameter) GetContext() (res PostgresDatabaseParameterG // GetContextOk returns a tuple with the Context field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) GetContextOk() (ret PostgresDatabaseParameterGetContextRetType, ok bool) { return getPostgresDatabaseParameterGetContextAttributeTypeOk(o.Context) } // HasContext returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) HasContext() bool { _, ok := o.GetContextOk() return ok } // SetContext gets a reference to the given string and assigns it to the Context field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) SetContext(v PostgresDatabaseParameterGetContextRetType) { setPostgresDatabaseParameterGetContextAttributeType(&o.Context, v) } // GetDataType returns the DataType field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) GetDataType() (res PostgresDatabaseParameterGetDataTypeRetType) { res, _ = o.GetDataTypeOk() return @@ -343,22 +426,26 @@ func (o *PostgresDatabaseParameter) GetDataType() (res PostgresDatabaseParameter // GetDataTypeOk returns a tuple with the DataType field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) GetDataTypeOk() (ret PostgresDatabaseParameterGetDataTypeRetType, ok bool) { return getPostgresDatabaseParameterGetDataTypeAttributeTypeOk(o.DataType) } // HasDataType returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) HasDataType() bool { _, ok := o.GetDataTypeOk() return ok } // SetDataType gets a reference to the given string and assigns it to the DataType field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) SetDataType(v PostgresDatabaseParameterGetDataTypeRetType) { setPostgresDatabaseParameterGetDataTypeAttributeType(&o.DataType, v) } // GetDefaultValue returns the DefaultValue field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) GetDefaultValue() (res PostgresDatabaseParameterGetDefaultValueRetType) { res, _ = o.GetDefaultValueOk() return @@ -366,22 +453,26 @@ func (o *PostgresDatabaseParameter) GetDefaultValue() (res PostgresDatabaseParam // GetDefaultValueOk returns a tuple with the DefaultValue field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) GetDefaultValueOk() (ret PostgresDatabaseParameterGetDefaultValueRetType, ok bool) { return getPostgresDatabaseParameterGetDefaultValueAttributeTypeOk(o.DefaultValue) } // HasDefaultValue returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) HasDefaultValue() bool { _, ok := o.GetDefaultValueOk() return ok } // SetDefaultValue gets a reference to the given string and assigns it to the DefaultValue field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) SetDefaultValue(v PostgresDatabaseParameterGetDefaultValueRetType) { setPostgresDatabaseParameterGetDefaultValueAttributeType(&o.DefaultValue, 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 *PostgresDatabaseParameter) GetDescription() (res PostgresDatabaseParameterGetDescriptionRetType) { res, _ = o.GetDescriptionOk() return @@ -389,22 +480,26 @@ func (o *PostgresDatabaseParameter) GetDescription() (res PostgresDatabaseParame // 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 *PostgresDatabaseParameter) GetDescriptionOk() (ret PostgresDatabaseParameterGetDescriptionRetType, ok bool) { return getPostgresDatabaseParameterGetDescriptionAttributeTypeOk(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 *PostgresDatabaseParameter) 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 *PostgresDatabaseParameter) SetDescription(v PostgresDatabaseParameterGetDescriptionRetType) { setPostgresDatabaseParameterGetDescriptionAttributeType(&o.Description, v) } // GetEdit returns the Edit field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) GetEdit() (res PostgresDatabaseParametergetEditRetType) { res, _ = o.GetEditOk() return @@ -412,22 +507,26 @@ func (o *PostgresDatabaseParameter) GetEdit() (res PostgresDatabaseParametergetE // GetEditOk returns a tuple with the Edit field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) GetEditOk() (ret PostgresDatabaseParametergetEditRetType, ok bool) { return getPostgresDatabaseParametergetEditAttributeTypeOk(o.Edit) } // HasEdit returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) HasEdit() bool { _, ok := o.GetEditOk() return ok } // SetEdit gets a reference to the given bool and assigns it to the Edit field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) SetEdit(v PostgresDatabaseParametergetEditRetType) { setPostgresDatabaseParametergetEditAttributeType(&o.Edit, v) } // GetMaxValue returns the MaxValue field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) GetMaxValue() (res PostgresDatabaseParameterGetMaxValueRetType) { res, _ = o.GetMaxValueOk() return @@ -435,22 +534,26 @@ func (o *PostgresDatabaseParameter) GetMaxValue() (res PostgresDatabaseParameter // GetMaxValueOk returns a tuple with the MaxValue field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) GetMaxValueOk() (ret PostgresDatabaseParameterGetMaxValueRetType, ok bool) { return getPostgresDatabaseParameterGetMaxValueAttributeTypeOk(o.MaxValue) } // HasMaxValue returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) HasMaxValue() bool { _, ok := o.GetMaxValueOk() return ok } // SetMaxValue gets a reference to the given string and assigns it to the MaxValue field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) SetMaxValue(v PostgresDatabaseParameterGetMaxValueRetType) { setPostgresDatabaseParameterGetMaxValueAttributeType(&o.MaxValue, v) } // GetMinValue returns the MinValue field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) GetMinValue() (res PostgresDatabaseParameterGetMinValueRetType) { res, _ = o.GetMinValueOk() return @@ -458,22 +561,26 @@ func (o *PostgresDatabaseParameter) GetMinValue() (res PostgresDatabaseParameter // GetMinValueOk returns a tuple with the MinValue field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) GetMinValueOk() (ret PostgresDatabaseParameterGetMinValueRetType, ok bool) { return getPostgresDatabaseParameterGetMinValueAttributeTypeOk(o.MinValue) } // HasMinValue returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) HasMinValue() bool { _, ok := o.GetMinValueOk() return ok } // SetMinValue gets a reference to the given string and assigns it to the MinValue field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) SetMinValue(v PostgresDatabaseParameterGetMinValueRetType) { setPostgresDatabaseParameterGetMinValueAttributeType(&o.MinValue, 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 *PostgresDatabaseParameter) GetName() (res PostgresDatabaseParameterGetNameRetType) { res, _ = o.GetNameOk() return @@ -481,22 +588,26 @@ func (o *PostgresDatabaseParameter) GetName() (res PostgresDatabaseParameterGetN // 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 *PostgresDatabaseParameter) GetNameOk() (ret PostgresDatabaseParameterGetNameRetType, ok bool) { return getPostgresDatabaseParameterGetNameAttributeTypeOk(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 *PostgresDatabaseParameter) 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 *PostgresDatabaseParameter) SetName(v PostgresDatabaseParameterGetNameRetType) { setPostgresDatabaseParameterGetNameAttributeType(&o.Name, v) } // GetPendingRestart returns the PendingRestart field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) GetPendingRestart() (res PostgresDatabaseParametergetPendingRestartRetType) { res, _ = o.GetPendingRestartOk() return @@ -504,22 +615,26 @@ func (o *PostgresDatabaseParameter) GetPendingRestart() (res PostgresDatabasePar // GetPendingRestartOk returns a tuple with the PendingRestart field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) GetPendingRestartOk() (ret PostgresDatabaseParametergetPendingRestartRetType, ok bool) { return getPostgresDatabaseParametergetPendingRestartAttributeTypeOk(o.PendingRestart) } // HasPendingRestart returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) HasPendingRestart() bool { _, ok := o.GetPendingRestartOk() return ok } // SetPendingRestart gets a reference to the given bool and assigns it to the PendingRestart field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) SetPendingRestart(v PostgresDatabaseParametergetPendingRestartRetType) { setPostgresDatabaseParametergetPendingRestartAttributeType(&o.PendingRestart, v) } // GetResetValue returns the ResetValue field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) GetResetValue() (res PostgresDatabaseParameterGetResetValueRetType) { res, _ = o.GetResetValueOk() return @@ -527,22 +642,26 @@ func (o *PostgresDatabaseParameter) GetResetValue() (res PostgresDatabaseParamet // GetResetValueOk returns a tuple with the ResetValue field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) GetResetValueOk() (ret PostgresDatabaseParameterGetResetValueRetType, ok bool) { return getPostgresDatabaseParameterGetResetValueAttributeTypeOk(o.ResetValue) } // HasResetValue returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) HasResetValue() bool { _, ok := o.GetResetValueOk() return ok } // SetResetValue gets a reference to the given string and assigns it to the ResetValue field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) SetResetValue(v PostgresDatabaseParameterGetResetValueRetType) { setPostgresDatabaseParameterGetResetValueAttributeType(&o.ResetValue, v) } // GetUnit returns the Unit field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) GetUnit() (res PostgresDatabaseParameterGetUnitRetType) { res, _ = o.GetUnitOk() return @@ -550,22 +669,26 @@ func (o *PostgresDatabaseParameter) GetUnit() (res PostgresDatabaseParameterGetU // GetUnitOk returns a tuple with the Unit field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) GetUnitOk() (ret PostgresDatabaseParameterGetUnitRetType, ok bool) { return getPostgresDatabaseParameterGetUnitAttributeTypeOk(o.Unit) } // HasUnit returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) HasUnit() bool { _, ok := o.GetUnitOk() return ok } // SetUnit gets a reference to the given string and assigns it to the Unit field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) SetUnit(v PostgresDatabaseParameterGetUnitRetType) { setPostgresDatabaseParameterGetUnitAttributeType(&o.Unit, v) } // GetValue returns the Value field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) GetValue() (res PostgresDatabaseParameterGetValueRetType) { res, _ = o.GetValueOk() return @@ -573,21 +696,25 @@ func (o *PostgresDatabaseParameter) GetValue() (res PostgresDatabaseParameterGet // GetValueOk returns a tuple with the Value field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) GetValueOk() (ret PostgresDatabaseParameterGetValueRetType, ok bool) { return getPostgresDatabaseParameterGetValueAttributeTypeOk(o.Value) } // HasValue returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) HasValue() bool { _, ok := o.GetValueOk() return ok } // SetValue gets a reference to the given string and assigns it to the Value field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameter) SetValue(v PostgresDatabaseParameterGetValueRetType) { setPostgresDatabaseParameterGetValueAttributeType(&o.Value, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o PostgresDatabaseParameter) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getPostgresDatabaseParameterGetContextAttributeTypeOk(o.Context); ok { @@ -629,37 +756,45 @@ func (o PostgresDatabaseParameter) 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 NullablePostgresDatabaseParameter struct { value *PostgresDatabaseParameter isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePostgresDatabaseParameter) Get() *PostgresDatabaseParameter { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePostgresDatabaseParameter) Set(val *PostgresDatabaseParameter) { 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 NullablePostgresDatabaseParameter) 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 *NullablePostgresDatabaseParameter) 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 NewNullablePostgresDatabaseParameter(val *PostgresDatabaseParameter) *NullablePostgresDatabaseParameter { return &NullablePostgresDatabaseParameter{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 NullablePostgresDatabaseParameter) 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 *NullablePostgresDatabaseParameter) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_postgres_database_parameter_response.go b/services/postgresflex/model_postgres_database_parameter_response.go index d469d7ff6..b95917343 100644 --- a/services/postgresflex/model_postgres_database_parameter_response.go +++ b/services/postgresflex/model_postgres_database_parameter_response.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &PostgresDatabaseParameterResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParameterResponseGetParameterAttributeType = *[]PostgresDatabaseParameter + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParameterResponseGetParameterArgType = []PostgresDatabaseParameter + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParameterResponseGetParameterRetType = []PostgresDatabaseParameter +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPostgresDatabaseParameterResponseGetParameterAttributeTypeOk(arg PostgresDatabaseParameterResponseGetParameterAttributeType) (ret PostgresDatabaseParameterResponseGetParameterRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getPostgresDatabaseParameterResponseGetParameterAttributeTypeOk(arg Postgre return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPostgresDatabaseParameterResponseGetParameterAttributeType(arg *PostgresDatabaseParameterResponseGetParameterAttributeType, val PostgresDatabaseParameterResponseGetParameterRetType) { *arg = &val } // PostgresDatabaseParameterResponse struct for PostgresDatabaseParameterResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PostgresDatabaseParameterResponse struct { // List of the parameter Parameter PostgresDatabaseParameterResponseGetParameterAttributeType `json:"parameter,omitempty"` @@ -47,6 +56,7 @@ type PostgresDatabaseParameterResponse 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 NewPostgresDatabaseParameterResponse() *PostgresDatabaseParameterResponse { this := PostgresDatabaseParameterResponse{} return &this @@ -55,12 +65,14 @@ func NewPostgresDatabaseParameterResponse() *PostgresDatabaseParameterResponse { // NewPostgresDatabaseParameterResponseWithDefaults instantiates a new PostgresDatabaseParameterResponse object // This 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 NewPostgresDatabaseParameterResponseWithDefaults() *PostgresDatabaseParameterResponse { this := PostgresDatabaseParameterResponse{} return &this } // GetParameter returns the Parameter field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameterResponse) GetParameter() (res PostgresDatabaseParameterResponseGetParameterRetType) { res, _ = o.GetParameterOk() return @@ -68,21 +80,25 @@ func (o *PostgresDatabaseParameterResponse) GetParameter() (res PostgresDatabase // GetParameterOk returns a tuple with the Parameter field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameterResponse) GetParameterOk() (ret PostgresDatabaseParameterResponseGetParameterRetType, ok bool) { return getPostgresDatabaseParameterResponseGetParameterAttributeTypeOk(o.Parameter) } // HasParameter returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameterResponse) HasParameter() bool { _, ok := o.GetParameterOk() return ok } // SetParameter gets a reference to the given []PostgresDatabaseParameter and assigns it to the Parameter field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PostgresDatabaseParameterResponse) SetParameter(v PostgresDatabaseParameterResponseGetParameterRetType) { setPostgresDatabaseParameterResponseGetParameterAttributeType(&o.Parameter, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o PostgresDatabaseParameterResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getPostgresDatabaseParameterResponseGetParameterAttributeTypeOk(o.Parameter); ok { @@ -91,37 +107,45 @@ func (o PostgresDatabaseParameterResponse) 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 NullablePostgresDatabaseParameterResponse struct { value *PostgresDatabaseParameterResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePostgresDatabaseParameterResponse) Get() *PostgresDatabaseParameterResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePostgresDatabaseParameterResponse) Set(val *PostgresDatabaseParameterResponse) { 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 NullablePostgresDatabaseParameterResponse) 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 *NullablePostgresDatabaseParameterResponse) 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 NewNullablePostgresDatabaseParameterResponse(val *PostgresDatabaseParameterResponse) *NullablePostgresDatabaseParameterResponse { return &NullablePostgresDatabaseParameterResponse{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 NullablePostgresDatabaseParameterResponse) 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 *NullablePostgresDatabaseParameterResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_reset_user_response.go b/services/postgresflex/model_reset_user_response.go index 4ff2ef111..685905cfa 100644 --- a/services/postgresflex/model_reset_user_response.go +++ b/services/postgresflex/model_reset_user_response.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ResetUserResponse{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ResetUserResponseGetItemAttributeType = *User + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ResetUserResponseGetItemArgType = User + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ResetUserResponseGetItemRetType = User +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getResetUserResponseGetItemAttributeTypeOk(arg ResetUserResponseGetItemAttributeType) (ret ResetUserResponseGetItemRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getResetUserResponseGetItemAttributeTypeOk(arg ResetUserResponseGetItemAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setResetUserResponseGetItemAttributeType(arg *ResetUserResponseGetItemAttributeType, val ResetUserResponseGetItemRetType) { *arg = &val } // ResetUserResponse struct for ResetUserResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ResetUserResponse struct { Item ResetUserResponseGetItemAttributeType `json:"item,omitempty"` } @@ -46,6 +55,7 @@ type ResetUserResponse 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 NewResetUserResponse() *ResetUserResponse { this := ResetUserResponse{} return &this @@ -54,12 +64,14 @@ func NewResetUserResponse() *ResetUserResponse { // NewResetUserResponseWithDefaults instantiates a new ResetUserResponse object // This 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 NewResetUserResponseWithDefaults() *ResetUserResponse { this := ResetUserResponse{} return &this } // GetItem returns the Item field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ResetUserResponse) GetItem() (res ResetUserResponseGetItemRetType) { res, _ = o.GetItemOk() return @@ -67,21 +79,25 @@ func (o *ResetUserResponse) GetItem() (res ResetUserResponseGetItemRetType) { // GetItemOk returns a tuple with the Item field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ResetUserResponse) GetItemOk() (ret ResetUserResponseGetItemRetType, ok bool) { return getResetUserResponseGetItemAttributeTypeOk(o.Item) } // HasItem returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ResetUserResponse) HasItem() bool { _, ok := o.GetItemOk() return ok } // SetItem gets a reference to the given User and assigns it to the Item field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ResetUserResponse) SetItem(v ResetUserResponseGetItemRetType) { setResetUserResponseGetItemAttributeType(&o.Item, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ResetUserResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getResetUserResponseGetItemAttributeTypeOk(o.Item); ok { @@ -90,37 +106,45 @@ func (o ResetUserResponse) 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 NullableResetUserResponse struct { value *ResetUserResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableResetUserResponse) Get() *ResetUserResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableResetUserResponse) Set(val *ResetUserResponse) { 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 NullableResetUserResponse) 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 *NullableResetUserResponse) 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 NewNullableResetUserResponse(val *ResetUserResponse) *NullableResetUserResponse { return &NullableResetUserResponse{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 NullableResetUserResponse) 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 *NullableResetUserResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_storage.go b/services/postgresflex/model_storage.go index 1c1fa94cf..33922e5b1 100644 --- a/services/postgresflex/model_storage.go +++ b/services/postgresflex/model_storage.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &Storage{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type StorageGetClassAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getStorageGetClassAttributeTypeOk(arg StorageGetClassAttributeType) (ret StorageGetClassRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getStorageGetClassAttributeTypeOk(arg StorageGetClassAttributeType) (ret St return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setStorageGetClassAttributeType(arg *StorageGetClassAttributeType, val StorageGetClassRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type StorageGetClassArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type StorageGetClassRetType = string /* @@ -43,10 +50,16 @@ type StorageGetClassRetType = string */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type StorageGetSizeAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type StorageGetSizeArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type StorageGetSizeRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getStorageGetSizeAttributeTypeOk(arg StorageGetSizeAttributeType) (ret StorageGetSizeRetType, ok bool) { if arg == nil { return ret, false @@ -54,11 +67,13 @@ func getStorageGetSizeAttributeTypeOk(arg StorageGetSizeAttributeType) (ret Stor return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setStorageGetSizeAttributeType(arg *StorageGetSizeAttributeType, val StorageGetSizeRetType) { *arg = &val } // Storage struct for Storage +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Storage struct { Class StorageGetClassAttributeType `json:"class,omitempty"` Size StorageGetSizeAttributeType `json:"size,omitempty"` @@ -68,6 +83,7 @@ type Storage 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 NewStorage() *Storage { this := Storage{} return &this @@ -76,12 +92,14 @@ func NewStorage() *Storage { // NewStorageWithDefaults instantiates a new Storage object // This 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 NewStorageWithDefaults() *Storage { this := Storage{} return &this } // GetClass returns the Class field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Storage) GetClass() (res StorageGetClassRetType) { res, _ = o.GetClassOk() return @@ -89,22 +107,26 @@ func (o *Storage) GetClass() (res StorageGetClassRetType) { // GetClassOk returns a tuple with the Class field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Storage) GetClassOk() (ret StorageGetClassRetType, ok bool) { return getStorageGetClassAttributeTypeOk(o.Class) } // HasClass returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Storage) HasClass() bool { _, ok := o.GetClassOk() return ok } // SetClass gets a reference to the given string and assigns it to the Class field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Storage) SetClass(v StorageGetClassRetType) { setStorageGetClassAttributeType(&o.Class, 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 *Storage) GetSize() (res StorageGetSizeRetType) { res, _ = o.GetSizeOk() return @@ -112,21 +134,25 @@ func (o *Storage) GetSize() (res StorageGetSizeRetType) { // 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 *Storage) GetSizeOk() (ret StorageGetSizeRetType, ok bool) { return getStorageGetSizeAttributeTypeOk(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 *Storage) 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 *Storage) SetSize(v StorageGetSizeRetType) { setStorageGetSizeAttributeType(&o.Size, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o Storage) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getStorageGetClassAttributeTypeOk(o.Class); ok { @@ -138,37 +164,45 @@ func (o Storage) 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 NullableStorage struct { value *Storage isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableStorage) Get() *Storage { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableStorage) Set(val *Storage) { 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 NullableStorage) 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 *NullableStorage) 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 NewNullableStorage(val *Storage) *NullableStorage { return &NullableStorage{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 NullableStorage) 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 *NullableStorage) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_storage_range.go b/services/postgresflex/model_storage_range.go index 022ebe8a4..6bc2fe6a1 100644 --- a/services/postgresflex/model_storage_range.go +++ b/services/postgresflex/model_storage_range.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &StorageRange{} */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type StorageRangeGetMaxAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type StorageRangeGetMaxArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type StorageRangeGetMaxRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getStorageRangeGetMaxAttributeTypeOk(arg StorageRangeGetMaxAttributeType) (ret StorageRangeGetMaxRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getStorageRangeGetMaxAttributeTypeOk(arg StorageRangeGetMaxAttributeType) ( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setStorageRangeGetMaxAttributeType(arg *StorageRangeGetMaxAttributeType, val StorageRangeGetMaxRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setStorageRangeGetMaxAttributeType(arg *StorageRangeGetMaxAttributeType, va */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type StorageRangeGetMinAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type StorageRangeGetMinArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type StorageRangeGetMinRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getStorageRangeGetMinAttributeTypeOk(arg StorageRangeGetMinAttributeType) (ret StorageRangeGetMinRetType, ok bool) { if arg == nil { return ret, false @@ -53,11 +67,13 @@ func getStorageRangeGetMinAttributeTypeOk(arg StorageRangeGetMinAttributeType) ( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setStorageRangeGetMinAttributeType(arg *StorageRangeGetMinAttributeType, val StorageRangeGetMinRetType) { *arg = &val } // StorageRange struct for StorageRange +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type StorageRange struct { Max StorageRangeGetMaxAttributeType `json:"max,omitempty"` Min StorageRangeGetMinAttributeType `json:"min,omitempty"` @@ -67,6 +83,7 @@ type StorageRange 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 NewStorageRange() *StorageRange { this := StorageRange{} return &this @@ -75,12 +92,14 @@ func NewStorageRange() *StorageRange { // NewStorageRangeWithDefaults instantiates a new StorageRange object // This 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 NewStorageRangeWithDefaults() *StorageRange { this := StorageRange{} return &this } // GetMax returns the Max field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *StorageRange) GetMax() (res StorageRangeGetMaxRetType) { res, _ = o.GetMaxOk() return @@ -88,22 +107,26 @@ func (o *StorageRange) GetMax() (res StorageRangeGetMaxRetType) { // GetMaxOk returns a tuple with the Max field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *StorageRange) GetMaxOk() (ret StorageRangeGetMaxRetType, ok bool) { return getStorageRangeGetMaxAttributeTypeOk(o.Max) } // HasMax returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *StorageRange) HasMax() bool { _, ok := o.GetMaxOk() return ok } // SetMax gets a reference to the given int64 and assigns it to the Max field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *StorageRange) SetMax(v StorageRangeGetMaxRetType) { setStorageRangeGetMaxAttributeType(&o.Max, v) } // GetMin returns the Min field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *StorageRange) GetMin() (res StorageRangeGetMinRetType) { res, _ = o.GetMinOk() return @@ -111,21 +134,25 @@ func (o *StorageRange) GetMin() (res StorageRangeGetMinRetType) { // GetMinOk returns a tuple with the Min field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *StorageRange) GetMinOk() (ret StorageRangeGetMinRetType, ok bool) { return getStorageRangeGetMinAttributeTypeOk(o.Min) } // HasMin returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *StorageRange) HasMin() bool { _, ok := o.GetMinOk() return ok } // SetMin gets a reference to the given int64 and assigns it to the Min field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *StorageRange) SetMin(v StorageRangeGetMinRetType) { setStorageRangeGetMinAttributeType(&o.Min, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o StorageRange) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getStorageRangeGetMaxAttributeTypeOk(o.Max); ok { @@ -137,37 +164,45 @@ func (o StorageRange) 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 NullableStorageRange struct { value *StorageRange isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableStorageRange) Get() *StorageRange { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableStorageRange) Set(val *StorageRange) { 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 NullableStorageRange) 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 *NullableStorageRange) 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 NewNullableStorageRange(val *StorageRange) *NullableStorageRange { return &NullableStorageRange{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 NullableStorageRange) 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 *NullableStorageRange) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_storage_update.go b/services/postgresflex/model_storage_update.go index caa00bf26..ac676e41f 100644 --- a/services/postgresflex/model_storage_update.go +++ b/services/postgresflex/model_storage_update.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &StorageUpdate{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type StorageUpdateGetClassAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getStorageUpdateGetClassAttributeTypeOk(arg StorageUpdateGetClassAttributeType) (ret StorageUpdateGetClassRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getStorageUpdateGetClassAttributeTypeOk(arg StorageUpdateGetClassAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setStorageUpdateGetClassAttributeType(arg *StorageUpdateGetClassAttributeType, val StorageUpdateGetClassRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type StorageUpdateGetClassArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type StorageUpdateGetClassRetType = string /* @@ -43,10 +50,16 @@ type StorageUpdateGetClassRetType = string */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type StorageUpdateGetSizeAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type StorageUpdateGetSizeArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type StorageUpdateGetSizeRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getStorageUpdateGetSizeAttributeTypeOk(arg StorageUpdateGetSizeAttributeType) (ret StorageUpdateGetSizeRetType, ok bool) { if arg == nil { return ret, false @@ -54,11 +67,13 @@ func getStorageUpdateGetSizeAttributeTypeOk(arg StorageUpdateGetSizeAttributeTyp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setStorageUpdateGetSizeAttributeType(arg *StorageUpdateGetSizeAttributeType, val StorageUpdateGetSizeRetType) { *arg = &val } // StorageUpdate struct for StorageUpdate +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type StorageUpdate struct { // Deprecated: ⚠️ **DEPRECATED AND NON-FUNCTIONAL:** Updating the performance class field is not possible. Class StorageUpdateGetClassAttributeType `json:"class,omitempty"` @@ -69,6 +84,7 @@ type StorageUpdate 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 NewStorageUpdate() *StorageUpdate { this := StorageUpdate{} return &this @@ -77,13 +93,14 @@ func NewStorageUpdate() *StorageUpdate { // NewStorageUpdateWithDefaults instantiates a new StorageUpdate object // This 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 NewStorageUpdateWithDefaults() *StorageUpdate { this := StorageUpdate{} return &this } // GetClass returns the Class field value if set, zero value otherwise. -// Deprecated +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *StorageUpdate) GetClass() (res StorageUpdateGetClassRetType) { res, _ = o.GetClassOk() return @@ -91,24 +108,26 @@ func (o *StorageUpdate) GetClass() (res StorageUpdateGetClassRetType) { // GetClassOk returns a tuple with the Class field value if set, nil otherwise // and a boolean to check if the value has been set. -// Deprecated +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *StorageUpdate) GetClassOk() (ret StorageUpdateGetClassRetType, ok bool) { return getStorageUpdateGetClassAttributeTypeOk(o.Class) } // HasClass returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *StorageUpdate) HasClass() bool { _, ok := o.GetClassOk() return ok } // SetClass gets a reference to the given string and assigns it to the Class field. -// Deprecated +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *StorageUpdate) SetClass(v StorageUpdateGetClassRetType) { setStorageUpdateGetClassAttributeType(&o.Class, 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 *StorageUpdate) GetSize() (res StorageUpdateGetSizeRetType) { res, _ = o.GetSizeOk() return @@ -116,21 +135,25 @@ func (o *StorageUpdate) GetSize() (res StorageUpdateGetSizeRetType) { // 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 *StorageUpdate) GetSizeOk() (ret StorageUpdateGetSizeRetType, ok bool) { return getStorageUpdateGetSizeAttributeTypeOk(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 *StorageUpdate) 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 *StorageUpdate) SetSize(v StorageUpdateGetSizeRetType) { setStorageUpdateGetSizeAttributeType(&o.Size, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o StorageUpdate) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getStorageUpdateGetClassAttributeTypeOk(o.Class); ok { @@ -142,37 +165,45 @@ func (o StorageUpdate) 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 NullableStorageUpdate struct { value *StorageUpdate isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableStorageUpdate) Get() *StorageUpdate { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableStorageUpdate) Set(val *StorageUpdate) { 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 NullableStorageUpdate) 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 *NullableStorageUpdate) 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 NewNullableStorageUpdate(val *StorageUpdate) *NullableStorageUpdate { return &NullableStorageUpdate{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 NullableStorageUpdate) 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 *NullableStorageUpdate) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_update_backup_schedule_payload.go b/services/postgresflex/model_update_backup_schedule_payload.go index 9a146c71f..b883a9273 100644 --- a/services/postgresflex/model_update_backup_schedule_payload.go +++ b/services/postgresflex/model_update_backup_schedule_payload.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &UpdateBackupSchedulePayload{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupSchedulePayloadGetBackupScheduleAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateBackupSchedulePayloadGetBackupScheduleAttributeTypeOk(arg UpdateBackupSchedulePayloadGetBackupScheduleAttributeType) (ret UpdateBackupSchedulePayloadGetBackupScheduleRetType, ok bool) { if arg == nil { return ret, false @@ -31,25 +34,32 @@ func getUpdateBackupSchedulePayloadGetBackupScheduleAttributeTypeOk(arg UpdateBa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateBackupSchedulePayloadGetBackupScheduleAttributeType(arg *UpdateBackupSchedulePayloadGetBackupScheduleAttributeType, val UpdateBackupSchedulePayloadGetBackupScheduleRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupSchedulePayloadGetBackupScheduleArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupSchedulePayloadGetBackupScheduleRetType = string // UpdateBackupSchedulePayload struct for UpdateBackupSchedulePayload +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupSchedulePayload struct { // REQUIRED BackupSchedule UpdateBackupSchedulePayloadGetBackupScheduleAttributeType `json:"backupSchedule" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _UpdateBackupSchedulePayload UpdateBackupSchedulePayload // NewUpdateBackupSchedulePayload instantiates a new UpdateBackupSchedulePayload object // This constructor will assign default values to properties that have it defined, // 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 NewUpdateBackupSchedulePayload(backupSchedule UpdateBackupSchedulePayloadGetBackupScheduleArgType) *UpdateBackupSchedulePayload { this := UpdateBackupSchedulePayload{} setUpdateBackupSchedulePayloadGetBackupScheduleAttributeType(&this.BackupSchedule, backupSchedule) @@ -59,12 +69,14 @@ func NewUpdateBackupSchedulePayload(backupSchedule UpdateBackupSchedulePayloadGe // NewUpdateBackupSchedulePayloadWithDefaults instantiates a new UpdateBackupSchedulePayload object // This 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 NewUpdateBackupSchedulePayloadWithDefaults() *UpdateBackupSchedulePayload { this := UpdateBackupSchedulePayload{} return &this } // GetBackupSchedule returns the BackupSchedule field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupSchedulePayload) GetBackupSchedule() (ret UpdateBackupSchedulePayloadGetBackupScheduleRetType) { ret, _ = o.GetBackupScheduleOk() return ret @@ -72,15 +84,18 @@ func (o *UpdateBackupSchedulePayload) GetBackupSchedule() (ret UpdateBackupSched // GetBackupScheduleOk returns a tuple with the BackupSchedule 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 *UpdateBackupSchedulePayload) GetBackupScheduleOk() (ret UpdateBackupSchedulePayloadGetBackupScheduleRetType, ok bool) { return getUpdateBackupSchedulePayloadGetBackupScheduleAttributeTypeOk(o.BackupSchedule) } // SetBackupSchedule sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupSchedulePayload) SetBackupSchedule(v UpdateBackupSchedulePayloadGetBackupScheduleRetType) { setUpdateBackupSchedulePayloadGetBackupScheduleAttributeType(&o.BackupSchedule, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o UpdateBackupSchedulePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getUpdateBackupSchedulePayloadGetBackupScheduleAttributeTypeOk(o.BackupSchedule); ok { @@ -89,37 +104,45 @@ func (o UpdateBackupSchedulePayload) 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 NullableUpdateBackupSchedulePayload struct { value *UpdateBackupSchedulePayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateBackupSchedulePayload) Get() *UpdateBackupSchedulePayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateBackupSchedulePayload) Set(val *UpdateBackupSchedulePayload) { 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 NullableUpdateBackupSchedulePayload) 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 *NullableUpdateBackupSchedulePayload) 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 NewNullableUpdateBackupSchedulePayload(val *UpdateBackupSchedulePayload) *NullableUpdateBackupSchedulePayload { return &NullableUpdateBackupSchedulePayload{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 NullableUpdateBackupSchedulePayload) 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 *NullableUpdateBackupSchedulePayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_update_instance_payload.go b/services/postgresflex/model_update_instance_payload.go index 4c50d6121..060c694d2 100644 --- a/services/postgresflex/model_update_instance_payload.go +++ b/services/postgresflex/model_update_instance_payload.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &UpdateInstancePayload{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateInstancePayloadGetAclAttributeType = *ACL + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateInstancePayloadGetAclArgType = ACL + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateInstancePayloadGetAclRetType = ACL +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateInstancePayloadGetAclAttributeTypeOk(arg UpdateInstancePayloadGetAclAttributeType) (ret UpdateInstancePayloadGetAclRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getUpdateInstancePayloadGetAclAttributeTypeOk(arg UpdateInstancePayloadGetA return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateInstancePayloadGetAclAttributeType(arg *UpdateInstancePayloadGetAclAttributeType, val UpdateInstancePayloadGetAclRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setUpdateInstancePayloadGetAclAttributeType(arg *UpdateInstancePayloadGetAc */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateInstancePayloadGetBackupScheduleAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateInstancePayloadGetBackupScheduleAttributeTypeOk(arg UpdateInstancePayloadGetBackupScheduleAttributeType) (ret UpdateInstancePayloadGetBackupScheduleRetType, ok bool) { if arg == nil { return ret, false @@ -51,11 +61,15 @@ func getUpdateInstancePayloadGetBackupScheduleAttributeTypeOk(arg UpdateInstance return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateInstancePayloadGetBackupScheduleAttributeType(arg *UpdateInstancePayloadGetBackupScheduleAttributeType, val UpdateInstancePayloadGetBackupScheduleRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateInstancePayloadGetBackupScheduleArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateInstancePayloadGetBackupScheduleRetType = string /* @@ -63,8 +77,10 @@ type UpdateInstancePayloadGetBackupScheduleRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateInstancePayloadGetFlavorIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateInstancePayloadGetFlavorIdAttributeTypeOk(arg UpdateInstancePayloadGetFlavorIdAttributeType) (ret UpdateInstancePayloadGetFlavorIdRetType, ok bool) { if arg == nil { return ret, false @@ -72,11 +88,15 @@ func getUpdateInstancePayloadGetFlavorIdAttributeTypeOk(arg UpdateInstancePayloa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateInstancePayloadGetFlavorIdAttributeType(arg *UpdateInstancePayloadGetFlavorIdAttributeType, val UpdateInstancePayloadGetFlavorIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateInstancePayloadGetFlavorIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateInstancePayloadGetFlavorIdRetType = string /* @@ -84,10 +104,16 @@ type UpdateInstancePayloadGetFlavorIdRetType = string */ // isContainer +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateInstancePayloadGetLabelsAttributeType = *map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateInstancePayloadGetLabelsArgType = map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateInstancePayloadGetLabelsRetType = map[string]string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateInstancePayloadGetLabelsAttributeTypeOk(arg UpdateInstancePayloadGetLabelsAttributeType) (ret UpdateInstancePayloadGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -95,6 +121,7 @@ func getUpdateInstancePayloadGetLabelsAttributeTypeOk(arg UpdateInstancePayloadG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateInstancePayloadGetLabelsAttributeType(arg *UpdateInstancePayloadGetLabelsAttributeType, val UpdateInstancePayloadGetLabelsRetType) { *arg = &val } @@ -104,8 +131,10 @@ func setUpdateInstancePayloadGetLabelsAttributeType(arg *UpdateInstancePayloadGe */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateInstancePayloadGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateInstancePayloadGetNameAttributeTypeOk(arg UpdateInstancePayloadGetNameAttributeType) (ret UpdateInstancePayloadGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -113,11 +142,15 @@ func getUpdateInstancePayloadGetNameAttributeTypeOk(arg UpdateInstancePayloadGet return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateInstancePayloadGetNameAttributeType(arg *UpdateInstancePayloadGetNameAttributeType, val UpdateInstancePayloadGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateInstancePayloadGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateInstancePayloadGetNameRetType = string /* @@ -125,10 +158,16 @@ type UpdateInstancePayloadGetNameRetType = string */ // isContainer +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateInstancePayloadGetOptionsAttributeType = *map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateInstancePayloadGetOptionsArgType = map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateInstancePayloadGetOptionsRetType = map[string]string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateInstancePayloadGetOptionsAttributeTypeOk(arg UpdateInstancePayloadGetOptionsAttributeType) (ret UpdateInstancePayloadGetOptionsRetType, ok bool) { if arg == nil { return ret, false @@ -136,6 +175,7 @@ func getUpdateInstancePayloadGetOptionsAttributeTypeOk(arg UpdateInstancePayload return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateInstancePayloadGetOptionsAttributeType(arg *UpdateInstancePayloadGetOptionsAttributeType, val UpdateInstancePayloadGetOptionsRetType) { *arg = &val } @@ -145,10 +185,16 @@ func setUpdateInstancePayloadGetOptionsAttributeType(arg *UpdateInstancePayloadG */ // isInteger +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateInstancePayloadGetReplicasAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateInstancePayloadGetReplicasArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateInstancePayloadGetReplicasRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateInstancePayloadGetReplicasAttributeTypeOk(arg UpdateInstancePayloadGetReplicasAttributeType) (ret UpdateInstancePayloadGetReplicasRetType, ok bool) { if arg == nil { return ret, false @@ -156,6 +202,7 @@ func getUpdateInstancePayloadGetReplicasAttributeTypeOk(arg UpdateInstancePayloa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateInstancePayloadGetReplicasAttributeType(arg *UpdateInstancePayloadGetReplicasAttributeType, val UpdateInstancePayloadGetReplicasRetType) { *arg = &val } @@ -165,10 +212,16 @@ func setUpdateInstancePayloadGetReplicasAttributeType(arg *UpdateInstancePayload */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateInstancePayloadGetStorageAttributeType = *StorageUpdate + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateInstancePayloadGetStorageArgType = StorageUpdate + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateInstancePayloadGetStorageRetType = StorageUpdate +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateInstancePayloadGetStorageAttributeTypeOk(arg UpdateInstancePayloadGetStorageAttributeType) (ret UpdateInstancePayloadGetStorageRetType, ok bool) { if arg == nil { return ret, false @@ -176,6 +229,7 @@ func getUpdateInstancePayloadGetStorageAttributeTypeOk(arg UpdateInstancePayload return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateInstancePayloadGetStorageAttributeType(arg *UpdateInstancePayloadGetStorageAttributeType, val UpdateInstancePayloadGetStorageRetType) { *arg = &val } @@ -185,8 +239,10 @@ func setUpdateInstancePayloadGetStorageAttributeType(arg *UpdateInstancePayloadG */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateInstancePayloadGetVersionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateInstancePayloadGetVersionAttributeTypeOk(arg UpdateInstancePayloadGetVersionAttributeType) (ret UpdateInstancePayloadGetVersionRetType, ok bool) { if arg == nil { return ret, false @@ -194,14 +250,19 @@ func getUpdateInstancePayloadGetVersionAttributeTypeOk(arg UpdateInstancePayload return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateInstancePayloadGetVersionAttributeType(arg *UpdateInstancePayloadGetVersionAttributeType, val UpdateInstancePayloadGetVersionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateInstancePayloadGetVersionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateInstancePayloadGetVersionRetType = string // UpdateInstancePayload struct for UpdateInstancePayload +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateInstancePayload struct { Acl UpdateInstancePayloadGetAclAttributeType `json:"acl,omitempty"` BackupSchedule UpdateInstancePayloadGetBackupScheduleAttributeType `json:"backupSchedule,omitempty"` @@ -220,6 +281,7 @@ type UpdateInstancePayload 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 NewUpdateInstancePayload() *UpdateInstancePayload { this := UpdateInstancePayload{} return &this @@ -228,12 +290,14 @@ func NewUpdateInstancePayload() *UpdateInstancePayload { // NewUpdateInstancePayloadWithDefaults instantiates a new UpdateInstancePayload object // This 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 NewUpdateInstancePayloadWithDefaults() *UpdateInstancePayload { this := UpdateInstancePayload{} return &this } // GetAcl returns the Acl field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) GetAcl() (res UpdateInstancePayloadGetAclRetType) { res, _ = o.GetAclOk() return @@ -241,22 +305,26 @@ func (o *UpdateInstancePayload) GetAcl() (res UpdateInstancePayloadGetAclRetType // GetAclOk returns a tuple with the Acl field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) GetAclOk() (ret UpdateInstancePayloadGetAclRetType, ok bool) { return getUpdateInstancePayloadGetAclAttributeTypeOk(o.Acl) } // HasAcl returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) HasAcl() bool { _, ok := o.GetAclOk() return ok } // SetAcl gets a reference to the given ACL and assigns it to the Acl field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) SetAcl(v UpdateInstancePayloadGetAclRetType) { setUpdateInstancePayloadGetAclAttributeType(&o.Acl, v) } // GetBackupSchedule returns the BackupSchedule field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) GetBackupSchedule() (res UpdateInstancePayloadGetBackupScheduleRetType) { res, _ = o.GetBackupScheduleOk() return @@ -264,22 +332,26 @@ func (o *UpdateInstancePayload) GetBackupSchedule() (res UpdateInstancePayloadGe // GetBackupScheduleOk returns a tuple with the BackupSchedule field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) GetBackupScheduleOk() (ret UpdateInstancePayloadGetBackupScheduleRetType, ok bool) { return getUpdateInstancePayloadGetBackupScheduleAttributeTypeOk(o.BackupSchedule) } // HasBackupSchedule returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) HasBackupSchedule() bool { _, ok := o.GetBackupScheduleOk() return ok } // SetBackupSchedule gets a reference to the given string and assigns it to the BackupSchedule field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) SetBackupSchedule(v UpdateInstancePayloadGetBackupScheduleRetType) { setUpdateInstancePayloadGetBackupScheduleAttributeType(&o.BackupSchedule, v) } // GetFlavorId returns the FlavorId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) GetFlavorId() (res UpdateInstancePayloadGetFlavorIdRetType) { res, _ = o.GetFlavorIdOk() return @@ -287,22 +359,26 @@ func (o *UpdateInstancePayload) GetFlavorId() (res UpdateInstancePayloadGetFlavo // GetFlavorIdOk returns a tuple with the FlavorId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) GetFlavorIdOk() (ret UpdateInstancePayloadGetFlavorIdRetType, ok bool) { return getUpdateInstancePayloadGetFlavorIdAttributeTypeOk(o.FlavorId) } // HasFlavorId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) HasFlavorId() bool { _, ok := o.GetFlavorIdOk() return ok } // SetFlavorId gets a reference to the given string and assigns it to the FlavorId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) SetFlavorId(v UpdateInstancePayloadGetFlavorIdRetType) { setUpdateInstancePayloadGetFlavorIdAttributeType(&o.FlavorId, 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 *UpdateInstancePayload) GetLabels() (res UpdateInstancePayloadGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -310,22 +386,26 @@ func (o *UpdateInstancePayload) GetLabels() (res UpdateInstancePayloadGetLabelsR // 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 *UpdateInstancePayload) GetLabelsOk() (ret UpdateInstancePayloadGetLabelsRetType, ok bool) { return getUpdateInstancePayloadGetLabelsAttributeTypeOk(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 *UpdateInstancePayload) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]string 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 *UpdateInstancePayload) SetLabels(v UpdateInstancePayloadGetLabelsRetType) { setUpdateInstancePayloadGetLabelsAttributeType(&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 *UpdateInstancePayload) GetName() (res UpdateInstancePayloadGetNameRetType) { res, _ = o.GetNameOk() return @@ -333,22 +413,26 @@ func (o *UpdateInstancePayload) GetName() (res UpdateInstancePayloadGetNameRetTy // 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 *UpdateInstancePayload) GetNameOk() (ret UpdateInstancePayloadGetNameRetType, ok bool) { return getUpdateInstancePayloadGetNameAttributeTypeOk(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 *UpdateInstancePayload) 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 *UpdateInstancePayload) SetName(v UpdateInstancePayloadGetNameRetType) { setUpdateInstancePayloadGetNameAttributeType(&o.Name, v) } // GetOptions returns the Options field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) GetOptions() (res UpdateInstancePayloadGetOptionsRetType) { res, _ = o.GetOptionsOk() return @@ -356,22 +440,26 @@ func (o *UpdateInstancePayload) GetOptions() (res UpdateInstancePayloadGetOption // GetOptionsOk returns a tuple with the Options field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) GetOptionsOk() (ret UpdateInstancePayloadGetOptionsRetType, ok bool) { return getUpdateInstancePayloadGetOptionsAttributeTypeOk(o.Options) } // HasOptions returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) HasOptions() bool { _, ok := o.GetOptionsOk() return ok } // SetOptions gets a reference to the given map[string]string and assigns it to the Options field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) SetOptions(v UpdateInstancePayloadGetOptionsRetType) { setUpdateInstancePayloadGetOptionsAttributeType(&o.Options, v) } // GetReplicas returns the Replicas field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) GetReplicas() (res UpdateInstancePayloadGetReplicasRetType) { res, _ = o.GetReplicasOk() return @@ -379,22 +467,26 @@ func (o *UpdateInstancePayload) GetReplicas() (res UpdateInstancePayloadGetRepli // GetReplicasOk returns a tuple with the Replicas field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) GetReplicasOk() (ret UpdateInstancePayloadGetReplicasRetType, ok bool) { return getUpdateInstancePayloadGetReplicasAttributeTypeOk(o.Replicas) } // HasReplicas returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) HasReplicas() bool { _, ok := o.GetReplicasOk() return ok } // SetReplicas gets a reference to the given int64 and assigns it to the Replicas field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) SetReplicas(v UpdateInstancePayloadGetReplicasRetType) { setUpdateInstancePayloadGetReplicasAttributeType(&o.Replicas, v) } // GetStorage returns the Storage field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) GetStorage() (res UpdateInstancePayloadGetStorageRetType) { res, _ = o.GetStorageOk() return @@ -402,22 +494,26 @@ func (o *UpdateInstancePayload) GetStorage() (res UpdateInstancePayloadGetStorag // GetStorageOk returns a tuple with the Storage field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) GetStorageOk() (ret UpdateInstancePayloadGetStorageRetType, ok bool) { return getUpdateInstancePayloadGetStorageAttributeTypeOk(o.Storage) } // HasStorage returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) HasStorage() bool { _, ok := o.GetStorageOk() return ok } // SetStorage gets a reference to the given StorageUpdate and assigns it to the Storage field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) SetStorage(v UpdateInstancePayloadGetStorageRetType) { setUpdateInstancePayloadGetStorageAttributeType(&o.Storage, v) } // GetVersion returns the Version field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) GetVersion() (res UpdateInstancePayloadGetVersionRetType) { res, _ = o.GetVersionOk() return @@ -425,21 +521,25 @@ func (o *UpdateInstancePayload) GetVersion() (res UpdateInstancePayloadGetVersio // GetVersionOk returns a tuple with the Version field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) GetVersionOk() (ret UpdateInstancePayloadGetVersionRetType, ok bool) { return getUpdateInstancePayloadGetVersionAttributeTypeOk(o.Version) } // HasVersion returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) HasVersion() bool { _, ok := o.GetVersionOk() return ok } // SetVersion gets a reference to the given string and assigns it to the Version field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) SetVersion(v UpdateInstancePayloadGetVersionRetType) { setUpdateInstancePayloadGetVersionAttributeType(&o.Version, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o UpdateInstancePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getUpdateInstancePayloadGetAclAttributeTypeOk(o.Acl); ok { @@ -472,37 +572,45 @@ func (o UpdateInstancePayload) 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 NullableUpdateInstancePayload struct { value *UpdateInstancePayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateInstancePayload) Get() *UpdateInstancePayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateInstancePayload) Set(val *UpdateInstancePayload) { 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 NullableUpdateInstancePayload) 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 *NullableUpdateInstancePayload) 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 NewNullableUpdateInstancePayload(val *UpdateInstancePayload) *NullableUpdateInstancePayload { return &NullableUpdateInstancePayload{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 NullableUpdateInstancePayload) 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 *NullableUpdateInstancePayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_update_user_payload.go b/services/postgresflex/model_update_user_payload.go index fedade0b3..80879a207 100644 --- a/services/postgresflex/model_update_user_payload.go +++ b/services/postgresflex/model_update_user_payload.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &UpdateUserPayload{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateUserPayloadGetDatabaseAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateUserPayloadGetDatabaseAttributeTypeOk(arg UpdateUserPayloadGetDatabaseAttributeType) (ret UpdateUserPayloadGetDatabaseRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getUpdateUserPayloadGetDatabaseAttributeTypeOk(arg UpdateUserPayloadGetData return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateUserPayloadGetDatabaseAttributeType(arg *UpdateUserPayloadGetDatabaseAttributeType, val UpdateUserPayloadGetDatabaseRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateUserPayloadGetDatabaseArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateUserPayloadGetDatabaseRetType = string /* @@ -43,10 +50,16 @@ type UpdateUserPayloadGetDatabaseRetType = string */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateUserPayloadGetRolesAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateUserPayloadGetRolesArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateUserPayloadGetRolesRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateUserPayloadGetRolesAttributeTypeOk(arg UpdateUserPayloadGetRolesAttributeType) (ret UpdateUserPayloadGetRolesRetType, ok bool) { if arg == nil { return ret, false @@ -54,11 +67,13 @@ func getUpdateUserPayloadGetRolesAttributeTypeOk(arg UpdateUserPayloadGetRolesAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateUserPayloadGetRolesAttributeType(arg *UpdateUserPayloadGetRolesAttributeType, val UpdateUserPayloadGetRolesRetType) { *arg = &val } // UpdateUserPayload struct for UpdateUserPayload +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateUserPayload struct { Database UpdateUserPayloadGetDatabaseAttributeType `json:"database,omitempty"` Roles UpdateUserPayloadGetRolesAttributeType `json:"roles,omitempty"` @@ -68,6 +83,7 @@ type UpdateUserPayload 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 NewUpdateUserPayload() *UpdateUserPayload { this := UpdateUserPayload{} return &this @@ -76,12 +92,14 @@ func NewUpdateUserPayload() *UpdateUserPayload { // NewUpdateUserPayloadWithDefaults instantiates a new UpdateUserPayload object // This 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 NewUpdateUserPayloadWithDefaults() *UpdateUserPayload { this := UpdateUserPayload{} return &this } // GetDatabase returns the Database field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateUserPayload) GetDatabase() (res UpdateUserPayloadGetDatabaseRetType) { res, _ = o.GetDatabaseOk() return @@ -89,22 +107,26 @@ func (o *UpdateUserPayload) GetDatabase() (res UpdateUserPayloadGetDatabaseRetTy // GetDatabaseOk returns a tuple with the Database field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateUserPayload) GetDatabaseOk() (ret UpdateUserPayloadGetDatabaseRetType, ok bool) { return getUpdateUserPayloadGetDatabaseAttributeTypeOk(o.Database) } // HasDatabase returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateUserPayload) HasDatabase() bool { _, ok := o.GetDatabaseOk() return ok } // SetDatabase gets a reference to the given string and assigns it to the Database field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateUserPayload) SetDatabase(v UpdateUserPayloadGetDatabaseRetType) { setUpdateUserPayloadGetDatabaseAttributeType(&o.Database, v) } // GetRoles returns the Roles field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateUserPayload) GetRoles() (res UpdateUserPayloadGetRolesRetType) { res, _ = o.GetRolesOk() return @@ -112,21 +134,25 @@ func (o *UpdateUserPayload) GetRoles() (res UpdateUserPayloadGetRolesRetType) { // GetRolesOk returns a tuple with the Roles field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateUserPayload) GetRolesOk() (ret UpdateUserPayloadGetRolesRetType, ok bool) { return getUpdateUserPayloadGetRolesAttributeTypeOk(o.Roles) } // HasRoles returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateUserPayload) HasRoles() bool { _, ok := o.GetRolesOk() return ok } // SetRoles gets a reference to the given []string and assigns it to the Roles field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateUserPayload) SetRoles(v UpdateUserPayloadGetRolesRetType) { setUpdateUserPayloadGetRolesAttributeType(&o.Roles, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o UpdateUserPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getUpdateUserPayloadGetDatabaseAttributeTypeOk(o.Database); ok { @@ -138,37 +164,45 @@ func (o UpdateUserPayload) 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 NullableUpdateUserPayload struct { value *UpdateUserPayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateUserPayload) Get() *UpdateUserPayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateUserPayload) Set(val *UpdateUserPayload) { 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 NullableUpdateUserPayload) 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 *NullableUpdateUserPayload) 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 NewNullableUpdateUserPayload(val *UpdateUserPayload) *NullableUpdateUserPayload { return &NullableUpdateUserPayload{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 NullableUpdateUserPayload) 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 *NullableUpdateUserPayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_user.go b/services/postgresflex/model_user.go index bfb19a64b..4bd4cbe5a 100644 --- a/services/postgresflex/model_user.go +++ b/services/postgresflex/model_user.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &User{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserGetDatabaseAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUserGetDatabaseAttributeTypeOk(arg UserGetDatabaseAttributeType) (ret UserGetDatabaseRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getUserGetDatabaseAttributeTypeOk(arg UserGetDatabaseAttributeType) (ret Us return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUserGetDatabaseAttributeType(arg *UserGetDatabaseAttributeType, val UserGetDatabaseRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserGetDatabaseArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserGetDatabaseRetType = string /* @@ -43,8 +50,10 @@ type UserGetDatabaseRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserGetHostAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUserGetHostAttributeTypeOk(arg UserGetHostAttributeType) (ret UserGetHostRetType, ok bool) { if arg == nil { return ret, false @@ -52,11 +61,15 @@ func getUserGetHostAttributeTypeOk(arg UserGetHostAttributeType) (ret UserGetHos return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUserGetHostAttributeType(arg *UserGetHostAttributeType, val UserGetHostRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserGetHostArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserGetHostRetType = string /* @@ -64,8 +77,10 @@ type UserGetHostRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUserGetIdAttributeTypeOk(arg UserGetIdAttributeType) (ret UserGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -73,11 +88,15 @@ func getUserGetIdAttributeTypeOk(arg UserGetIdAttributeType) (ret UserGetIdRetTy return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUserGetIdAttributeType(arg *UserGetIdAttributeType, val UserGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserGetIdRetType = string /* @@ -85,8 +104,10 @@ type UserGetIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserGetPasswordAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUserGetPasswordAttributeTypeOk(arg UserGetPasswordAttributeType) (ret UserGetPasswordRetType, ok bool) { if arg == nil { return ret, false @@ -94,11 +115,15 @@ func getUserGetPasswordAttributeTypeOk(arg UserGetPasswordAttributeType) (ret Us return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUserGetPasswordAttributeType(arg *UserGetPasswordAttributeType, val UserGetPasswordRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserGetPasswordArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserGetPasswordRetType = string /* @@ -106,10 +131,16 @@ type UserGetPasswordRetType = string */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserGetPortAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserGetPortArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserGetPortRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUserGetPortAttributeTypeOk(arg UserGetPortAttributeType) (ret UserGetPortRetType, ok bool) { if arg == nil { return ret, false @@ -117,6 +148,7 @@ func getUserGetPortAttributeTypeOk(arg UserGetPortAttributeType) (ret UserGetPor return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUserGetPortAttributeType(arg *UserGetPortAttributeType, val UserGetPortRetType) { *arg = &val } @@ -126,10 +158,16 @@ func setUserGetPortAttributeType(arg *UserGetPortAttributeType, val UserGetPortR */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserGetRolesAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserGetRolesArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserGetRolesRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUserGetRolesAttributeTypeOk(arg UserGetRolesAttributeType) (ret UserGetRolesRetType, ok bool) { if arg == nil { return ret, false @@ -137,6 +175,7 @@ func getUserGetRolesAttributeTypeOk(arg UserGetRolesAttributeType) (ret UserGetR return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUserGetRolesAttributeType(arg *UserGetRolesAttributeType, val UserGetRolesRetType) { *arg = &val } @@ -146,8 +185,10 @@ func setUserGetRolesAttributeType(arg *UserGetRolesAttributeType, val UserGetRol */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserGetUriAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUserGetUriAttributeTypeOk(arg UserGetUriAttributeType) (ret UserGetUriRetType, ok bool) { if arg == nil { return ret, false @@ -155,11 +196,15 @@ func getUserGetUriAttributeTypeOk(arg UserGetUriAttributeType) (ret UserGetUriRe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUserGetUriAttributeType(arg *UserGetUriAttributeType, val UserGetUriRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserGetUriArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserGetUriRetType = string /* @@ -167,8 +212,10 @@ type UserGetUriRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserGetUsernameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUserGetUsernameAttributeTypeOk(arg UserGetUsernameAttributeType) (ret UserGetUsernameRetType, ok bool) { if arg == nil { return ret, false @@ -176,14 +223,19 @@ func getUserGetUsernameAttributeTypeOk(arg UserGetUsernameAttributeType) (ret Us return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUserGetUsernameAttributeType(arg *UserGetUsernameAttributeType, val UserGetUsernameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserGetUsernameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserGetUsernameRetType = string // User struct for User +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type User struct { Database UserGetDatabaseAttributeType `json:"database,omitempty"` Host UserGetHostAttributeType `json:"host,omitempty"` @@ -199,6 +251,7 @@ type User 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 NewUser() *User { this := User{} return &this @@ -207,12 +260,14 @@ func NewUser() *User { // NewUserWithDefaults instantiates a new User object // This 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 NewUserWithDefaults() *User { this := User{} return &this } // GetDatabase returns the Database field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *User) GetDatabase() (res UserGetDatabaseRetType) { res, _ = o.GetDatabaseOk() return @@ -220,22 +275,26 @@ func (o *User) GetDatabase() (res UserGetDatabaseRetType) { // GetDatabaseOk returns a tuple with the Database field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *User) GetDatabaseOk() (ret UserGetDatabaseRetType, ok bool) { return getUserGetDatabaseAttributeTypeOk(o.Database) } // HasDatabase returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *User) HasDatabase() bool { _, ok := o.GetDatabaseOk() return ok } // SetDatabase gets a reference to the given string and assigns it to the Database field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *User) SetDatabase(v UserGetDatabaseRetType) { setUserGetDatabaseAttributeType(&o.Database, v) } // GetHost returns the Host field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *User) GetHost() (res UserGetHostRetType) { res, _ = o.GetHostOk() return @@ -243,22 +302,26 @@ func (o *User) GetHost() (res UserGetHostRetType) { // GetHostOk returns a tuple with the Host field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *User) GetHostOk() (ret UserGetHostRetType, ok bool) { return getUserGetHostAttributeTypeOk(o.Host) } // HasHost returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *User) HasHost() bool { _, ok := o.GetHostOk() return ok } // SetHost gets a reference to the given string and assigns it to the Host field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *User) SetHost(v UserGetHostRetType) { setUserGetHostAttributeType(&o.Host, 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 *User) GetId() (res UserGetIdRetType) { res, _ = o.GetIdOk() return @@ -266,22 +329,26 @@ func (o *User) GetId() (res UserGetIdRetType) { // 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 *User) GetIdOk() (ret UserGetIdRetType, ok bool) { return getUserGetIdAttributeTypeOk(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 *User) 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 *User) SetId(v UserGetIdRetType) { setUserGetIdAttributeType(&o.Id, v) } // GetPassword returns the Password field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *User) GetPassword() (res UserGetPasswordRetType) { res, _ = o.GetPasswordOk() return @@ -289,22 +356,26 @@ func (o *User) GetPassword() (res UserGetPasswordRetType) { // GetPasswordOk returns a tuple with the Password field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *User) GetPasswordOk() (ret UserGetPasswordRetType, ok bool) { return getUserGetPasswordAttributeTypeOk(o.Password) } // HasPassword returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *User) HasPassword() bool { _, ok := o.GetPasswordOk() return ok } // SetPassword gets a reference to the given string and assigns it to the Password field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *User) SetPassword(v UserGetPasswordRetType) { setUserGetPasswordAttributeType(&o.Password, v) } // GetPort returns the Port field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *User) GetPort() (res UserGetPortRetType) { res, _ = o.GetPortOk() return @@ -312,22 +383,26 @@ func (o *User) GetPort() (res UserGetPortRetType) { // GetPortOk returns a tuple with the Port field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *User) GetPortOk() (ret UserGetPortRetType, ok bool) { return getUserGetPortAttributeTypeOk(o.Port) } // HasPort returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *User) HasPort() bool { _, ok := o.GetPortOk() return ok } // SetPort gets a reference to the given int64 and assigns it to the Port field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *User) SetPort(v UserGetPortRetType) { setUserGetPortAttributeType(&o.Port, v) } // GetRoles returns the Roles field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *User) GetRoles() (res UserGetRolesRetType) { res, _ = o.GetRolesOk() return @@ -335,22 +410,26 @@ func (o *User) GetRoles() (res UserGetRolesRetType) { // GetRolesOk returns a tuple with the Roles field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *User) GetRolesOk() (ret UserGetRolesRetType, ok bool) { return getUserGetRolesAttributeTypeOk(o.Roles) } // HasRoles returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *User) HasRoles() bool { _, ok := o.GetRolesOk() return ok } // SetRoles gets a reference to the given []string and assigns it to the Roles field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *User) SetRoles(v UserGetRolesRetType) { setUserGetRolesAttributeType(&o.Roles, v) } // GetUri returns the Uri field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *User) GetUri() (res UserGetUriRetType) { res, _ = o.GetUriOk() return @@ -358,22 +437,26 @@ func (o *User) GetUri() (res UserGetUriRetType) { // GetUriOk returns a tuple with the Uri field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *User) GetUriOk() (ret UserGetUriRetType, ok bool) { return getUserGetUriAttributeTypeOk(o.Uri) } // HasUri returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *User) HasUri() bool { _, ok := o.GetUriOk() return ok } // SetUri gets a reference to the given string and assigns it to the Uri field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *User) SetUri(v UserGetUriRetType) { setUserGetUriAttributeType(&o.Uri, v) } // GetUsername returns the Username field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *User) GetUsername() (res UserGetUsernameRetType) { res, _ = o.GetUsernameOk() return @@ -381,21 +464,25 @@ func (o *User) GetUsername() (res UserGetUsernameRetType) { // GetUsernameOk returns a tuple with the Username field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *User) GetUsernameOk() (ret UserGetUsernameRetType, ok bool) { return getUserGetUsernameAttributeTypeOk(o.Username) } // HasUsername returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *User) HasUsername() bool { _, ok := o.GetUsernameOk() return ok } // SetUsername gets a reference to the given string and assigns it to the Username field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *User) SetUsername(v UserGetUsernameRetType) { setUserGetUsernameAttributeType(&o.Username, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o User) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getUserGetDatabaseAttributeTypeOk(o.Database); ok { @@ -425,37 +512,45 @@ func (o User) 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 NullableUser struct { value *User isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUser) Get() *User { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUser) Set(val *User) { 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 NullableUser) 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 *NullableUser) 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 NewNullableUser(val *User) *NullableUser { return &NullableUser{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 NullableUser) 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 *NullableUser) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/model_user_response.go b/services/postgresflex/model_user_response.go index 76ad6a067..460a6ddaa 100644 --- a/services/postgresflex/model_user_response.go +++ b/services/postgresflex/model_user_response.go @@ -8,6 +8,7 @@ API version: 2.0.0 // 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 postgresflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &UserResponse{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserResponseGetHostAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUserResponseGetHostAttributeTypeOk(arg UserResponseGetHostAttributeType) (ret UserResponseGetHostRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getUserResponseGetHostAttributeTypeOk(arg UserResponseGetHostAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUserResponseGetHostAttributeType(arg *UserResponseGetHostAttributeType, val UserResponseGetHostRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserResponseGetHostArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserResponseGetHostRetType = string /* @@ -43,8 +50,10 @@ type UserResponseGetHostRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserResponseGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUserResponseGetIdAttributeTypeOk(arg UserResponseGetIdAttributeType) (ret UserResponseGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -52,11 +61,15 @@ func getUserResponseGetIdAttributeTypeOk(arg UserResponseGetIdAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUserResponseGetIdAttributeType(arg *UserResponseGetIdAttributeType, val UserResponseGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserResponseGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserResponseGetIdRetType = string /* @@ -64,10 +77,16 @@ type UserResponseGetIdRetType = string */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserResponseGetPortAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserResponseGetPortArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserResponseGetPortRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUserResponseGetPortAttributeTypeOk(arg UserResponseGetPortAttributeType) (ret UserResponseGetPortRetType, ok bool) { if arg == nil { return ret, false @@ -75,6 +94,7 @@ func getUserResponseGetPortAttributeTypeOk(arg UserResponseGetPortAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUserResponseGetPortAttributeType(arg *UserResponseGetPortAttributeType, val UserResponseGetPortRetType) { *arg = &val } @@ -84,10 +104,16 @@ func setUserResponseGetPortAttributeType(arg *UserResponseGetPortAttributeType, */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserResponseGetRolesAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserResponseGetRolesArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserResponseGetRolesRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUserResponseGetRolesAttributeTypeOk(arg UserResponseGetRolesAttributeType) (ret UserResponseGetRolesRetType, ok bool) { if arg == nil { return ret, false @@ -95,6 +121,7 @@ func getUserResponseGetRolesAttributeTypeOk(arg UserResponseGetRolesAttributeTyp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUserResponseGetRolesAttributeType(arg *UserResponseGetRolesAttributeType, val UserResponseGetRolesRetType) { *arg = &val } @@ -104,8 +131,10 @@ func setUserResponseGetRolesAttributeType(arg *UserResponseGetRolesAttributeType */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserResponseGetUsernameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUserResponseGetUsernameAttributeTypeOk(arg UserResponseGetUsernameAttributeType) (ret UserResponseGetUsernameRetType, ok bool) { if arg == nil { return ret, false @@ -113,14 +142,19 @@ func getUserResponseGetUsernameAttributeTypeOk(arg UserResponseGetUsernameAttrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUserResponseGetUsernameAttributeType(arg *UserResponseGetUsernameAttributeType, val UserResponseGetUsernameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserResponseGetUsernameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserResponseGetUsernameRetType = string // UserResponse struct for UserResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserResponse struct { Host UserResponseGetHostAttributeType `json:"host,omitempty"` Id UserResponseGetIdAttributeType `json:"id,omitempty"` @@ -133,6 +167,7 @@ type UserResponse 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 NewUserResponse() *UserResponse { this := UserResponse{} return &this @@ -141,12 +176,14 @@ func NewUserResponse() *UserResponse { // NewUserResponseWithDefaults instantiates a new UserResponse object // This 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 NewUserResponseWithDefaults() *UserResponse { this := UserResponse{} return &this } // GetHost returns the Host field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UserResponse) GetHost() (res UserResponseGetHostRetType) { res, _ = o.GetHostOk() return @@ -154,22 +191,26 @@ func (o *UserResponse) GetHost() (res UserResponseGetHostRetType) { // GetHostOk returns a tuple with the Host field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UserResponse) GetHostOk() (ret UserResponseGetHostRetType, ok bool) { return getUserResponseGetHostAttributeTypeOk(o.Host) } // HasHost returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UserResponse) HasHost() bool { _, ok := o.GetHostOk() return ok } // SetHost gets a reference to the given string and assigns it to the Host field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UserResponse) SetHost(v UserResponseGetHostRetType) { setUserResponseGetHostAttributeType(&o.Host, 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 *UserResponse) GetId() (res UserResponseGetIdRetType) { res, _ = o.GetIdOk() return @@ -177,22 +218,26 @@ func (o *UserResponse) GetId() (res UserResponseGetIdRetType) { // 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 *UserResponse) GetIdOk() (ret UserResponseGetIdRetType, ok bool) { return getUserResponseGetIdAttributeTypeOk(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 *UserResponse) 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 *UserResponse) SetId(v UserResponseGetIdRetType) { setUserResponseGetIdAttributeType(&o.Id, v) } // GetPort returns the Port field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UserResponse) GetPort() (res UserResponseGetPortRetType) { res, _ = o.GetPortOk() return @@ -200,22 +245,26 @@ func (o *UserResponse) GetPort() (res UserResponseGetPortRetType) { // GetPortOk returns a tuple with the Port field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UserResponse) GetPortOk() (ret UserResponseGetPortRetType, ok bool) { return getUserResponseGetPortAttributeTypeOk(o.Port) } // HasPort returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UserResponse) HasPort() bool { _, ok := o.GetPortOk() return ok } // SetPort gets a reference to the given int64 and assigns it to the Port field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UserResponse) SetPort(v UserResponseGetPortRetType) { setUserResponseGetPortAttributeType(&o.Port, v) } // GetRoles returns the Roles field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UserResponse) GetRoles() (res UserResponseGetRolesRetType) { res, _ = o.GetRolesOk() return @@ -223,22 +272,26 @@ func (o *UserResponse) GetRoles() (res UserResponseGetRolesRetType) { // GetRolesOk returns a tuple with the Roles field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UserResponse) GetRolesOk() (ret UserResponseGetRolesRetType, ok bool) { return getUserResponseGetRolesAttributeTypeOk(o.Roles) } // HasRoles returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UserResponse) HasRoles() bool { _, ok := o.GetRolesOk() return ok } // SetRoles gets a reference to the given []string and assigns it to the Roles field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UserResponse) SetRoles(v UserResponseGetRolesRetType) { setUserResponseGetRolesAttributeType(&o.Roles, v) } // GetUsername returns the Username field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UserResponse) GetUsername() (res UserResponseGetUsernameRetType) { res, _ = o.GetUsernameOk() return @@ -246,21 +299,25 @@ func (o *UserResponse) GetUsername() (res UserResponseGetUsernameRetType) { // GetUsernameOk returns a tuple with the Username field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UserResponse) GetUsernameOk() (ret UserResponseGetUsernameRetType, ok bool) { return getUserResponseGetUsernameAttributeTypeOk(o.Username) } // HasUsername returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UserResponse) HasUsername() bool { _, ok := o.GetUsernameOk() return ok } // SetUsername gets a reference to the given string and assigns it to the Username field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UserResponse) SetUsername(v UserResponseGetUsernameRetType) { setUserResponseGetUsernameAttributeType(&o.Username, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o UserResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getUserResponseGetHostAttributeTypeOk(o.Host); ok { @@ -281,37 +338,45 @@ func (o UserResponse) 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 NullableUserResponse struct { value *UserResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUserResponse) Get() *UserResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUserResponse) Set(val *UserResponse) { 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 NullableUserResponse) 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 *NullableUserResponse) 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 NewNullableUserResponse(val *UserResponse) *NullableUserResponse { return &NullableUserResponse{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 NullableUserResponse) 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 *NullableUserResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/postgresflex/oas_commit b/services/postgresflex/oas_commit index 588ee296b..dfee00bb5 100644 --- a/services/postgresflex/oas_commit +++ b/services/postgresflex/oas_commit @@ -1 +1 @@ -964ac4ce34f0b6417f2496a1d48585c4926dee3a +3b7ac6ac6cff4c57cb55162cf37bd3dd9be21ea4 diff --git a/services/postgresflex/utils.go b/services/postgresflex/utils.go index 24b1dd201..3554b3ece 100644 --- a/services/postgresflex/utils.go +++ b/services/postgresflex/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/postgresflex/v1api/api_default.go b/services/postgresflex/v1api/api_default.go new file mode 100644 index 000000000..53f71c860 --- /dev/null +++ b/services/postgresflex/v1api/api_default.go @@ -0,0 +1,4030 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// 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 { + + /* + CloneInstance Clone Instance + + Clone an existing instance of a postgres database to a new destination instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param instanceId Instance ID + @return ApiCloneInstanceRequest + */ + CloneInstance(ctx context.Context, projectId string, instanceId string) ApiCloneInstanceRequest + + // CloneInstanceExecute executes the request + // @return CloneInstanceResponse + CloneInstanceExecute(r ApiCloneInstanceRequest) (*CloneInstanceResponse, error) + + /* + CreateDatabase Create Database + + Create database for a user + Note: The name of a valid user must be provided in the "options" map field using the key "owner" + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param instanceId Instance ID + @return ApiCreateDatabaseRequest + */ + CreateDatabase(ctx context.Context, projectId string, instanceId string) ApiCreateDatabaseRequest + + // CreateDatabaseExecute executes the request + // @return InstanceCreateDatabaseResponse + CreateDatabaseExecute(r ApiCreateDatabaseRequest) (*InstanceCreateDatabaseResponse, error) + + /* + CreateInstance Create Instance + + Create a new instance of a postgres database + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @return ApiCreateInstanceRequest + */ + CreateInstance(ctx context.Context, projectId string) ApiCreateInstanceRequest + + // CreateInstanceExecute executes the request + // @return CreateInstanceResponse + CreateInstanceExecute(r ApiCreateInstanceRequest) (*CreateInstanceResponse, error) + + /* + CreateUser Create User + + Create user for an instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param instanceId Instance ID + @return ApiCreateUserRequest + */ + CreateUser(ctx context.Context, projectId string, instanceId string) ApiCreateUserRequest + + // CreateUserExecute executes the request + // @return CreateUserResponse + CreateUserExecute(r ApiCreateUserRequest) (*CreateUserResponse, error) + + /* + DeleteDatabase Delete Database + + Delete database for an instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param instanceId Instance ID + @param databaseId Database ID + @return ApiDeleteDatabaseRequest + */ + DeleteDatabase(ctx context.Context, projectId string, instanceId string, databaseId string) ApiDeleteDatabaseRequest + + // DeleteDatabaseExecute executes the request + DeleteDatabaseExecute(r ApiDeleteDatabaseRequest) error + + /* + DeleteInstance Delete Instance + + Delete available instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param instanceId Instance ID + @return ApiDeleteInstanceRequest + */ + DeleteInstance(ctx context.Context, projectId string, instanceId string) ApiDeleteInstanceRequest + + // DeleteInstanceExecute executes the request + DeleteInstanceExecute(r ApiDeleteInstanceRequest) error + + /* + DeleteUser Delete User + + Delete user for an instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param instanceId Instance ID + @param userId User ID + @return ApiDeleteUserRequest + */ + DeleteUser(ctx context.Context, projectId string, instanceId string, userId string) ApiDeleteUserRequest + + // DeleteUserExecute executes the request + DeleteUserExecute(r ApiDeleteUserRequest) error + + /* + ForceDeleteInstance Force delete instance + + Forces the deletion of an delayed deleted instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param instanceId Instance ID + @return ApiForceDeleteInstanceRequest + */ + ForceDeleteInstance(ctx context.Context, projectId string, instanceId string) ApiForceDeleteInstanceRequest + + // ForceDeleteInstanceExecute executes the request + ForceDeleteInstanceExecute(r ApiForceDeleteInstanceRequest) error + + /* + GetBackup Get specific backup + + Get specific available backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param instanceId Instance ID + @param backupId Backup ID + @return ApiGetBackupRequest + */ + GetBackup(ctx context.Context, projectId string, instanceId string, backupId string) ApiGetBackupRequest + + // GetBackupExecute executes the request + // @return GetBackupResponse + GetBackupExecute(r ApiGetBackupRequest) (*GetBackupResponse, error) + + /* + GetInstance Get specific instance + + Get specific available instances + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param instanceId Instance ID + @return ApiGetInstanceRequest + */ + GetInstance(ctx context.Context, projectId string, instanceId string) ApiGetInstanceRequest + + // GetInstanceExecute executes the request + // @return InstanceResponse + GetInstanceExecute(r ApiGetInstanceRequest) (*InstanceResponse, error) + + /* + GetUser Get User + + Get specific available user for an instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param instanceId Instance ID + @param userId User ID + @return ApiGetUserRequest + */ + GetUser(ctx context.Context, projectId string, instanceId string, userId string) ApiGetUserRequest + + // GetUserExecute executes the request + // @return GetUserResponse + GetUserExecute(r ApiGetUserRequest) (*GetUserResponse, error) + + /* + ListBackups List backups + + List all backups which are available for a specific instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param instanceId Instance ID + @return ApiListBackupsRequest + */ + ListBackups(ctx context.Context, projectId string, instanceId string) ApiListBackupsRequest + + // ListBackupsExecute executes the request + // @return ListBackupsResponse + ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupsResponse, error) + + /* + ListDatabaseParameters List Databases parameter + + List available databases parameter + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param instanceId Instance ID + @return ApiListDatabaseParametersRequest + */ + ListDatabaseParameters(ctx context.Context, projectId string, instanceId string) ApiListDatabaseParametersRequest + + // ListDatabaseParametersExecute executes the request + // @return PostgresDatabaseParameterResponse + ListDatabaseParametersExecute(r ApiListDatabaseParametersRequest) (*PostgresDatabaseParameterResponse, error) + + /* + ListDatabases List Databases + + List available databases for an instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param instanceId Instance ID + @return ApiListDatabasesRequest + */ + ListDatabases(ctx context.Context, projectId string, instanceId string) ApiListDatabasesRequest + + // ListDatabasesExecute executes the request + // @return InstanceListDatabasesResponse + ListDatabasesExecute(r ApiListDatabasesRequest) (*InstanceListDatabasesResponse, error) + + /* + ListFlavors Get Flavors + + Get available flavors for a specific projectID + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @return ApiListFlavorsRequest + */ + ListFlavors(ctx context.Context, projectId string) ApiListFlavorsRequest + + // ListFlavorsExecute executes the request + // @return ListFlavorsResponse + ListFlavorsExecute(r ApiListFlavorsRequest) (*ListFlavorsResponse, error) + + /* + ListInstances List Instances + + List available instances + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @return ApiListInstancesRequest + */ + ListInstances(ctx context.Context, projectId string) ApiListInstancesRequest + + // ListInstancesExecute executes the request + // @return ListInstancesResponse + ListInstancesExecute(r ApiListInstancesRequest) (*ListInstancesResponse, error) + + /* + ListMetrics Get Metric + + Returns a metric for an instance. The metric will only be for the master pod if needed. Granularity parameter is always needed. If start and end time is provided, period is not considered in connections and disk-use. If you provide start time, you have to provide end time as well and vice versa. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The UUID of the project. + @param instanceId The UUID of the instance. + @param metric The name of the metric. Valid metrics are 'cpu', 'memory', 'disk-use', 'disk-size' and 'connections'. + @return ApiListMetricsRequest + */ + ListMetrics(ctx context.Context, projectId string, instanceId string, metric string) ApiListMetricsRequest + + // ListMetricsExecute executes the request + // @return InstanceMetricsResponse + ListMetricsExecute(r ApiListMetricsRequest) (*InstanceMetricsResponse, error) + + /* + ListStorages Get Storages + + Get available storages for a specific flavor + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param flavorId Flavor ID + @return ApiListStoragesRequest + */ + ListStorages(ctx context.Context, projectId string, flavorId string) ApiListStoragesRequest + + // ListStoragesExecute executes the request + // @return ListStoragesResponse + ListStoragesExecute(r ApiListStoragesRequest) (*ListStoragesResponse, error) + + /* + ListUsers List Users + + List available users for an instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param instanceId Instance ID + @return ApiListUsersRequest + */ + ListUsers(ctx context.Context, projectId string, instanceId string) ApiListUsersRequest + + // ListUsersExecute executes the request + // @return ListUsersResponse + ListUsersExecute(r ApiListUsersRequest) (*ListUsersResponse, error) + + /* + ListVersions Get Versions + + Get available versions for postgres database + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @return ApiListVersionsRequest + */ + ListVersions(ctx context.Context, projectId string) ApiListVersionsRequest + + // ListVersionsExecute executes the request + // @return ListVersionsResponse + ListVersionsExecute(r ApiListVersionsRequest) (*ListVersionsResponse, error) + + /* + PartialUpdateInstance Update Instance + + Update available instance of a postgres database. Supported Versions are 12, 13, 14, 15 -- only upgrades are allowed! + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param instanceId Instance ID + @return ApiPartialUpdateInstanceRequest + */ + PartialUpdateInstance(ctx context.Context, projectId string, instanceId string) ApiPartialUpdateInstanceRequest + + // PartialUpdateInstanceExecute executes the request + // @return PartialUpdateInstanceResponse + PartialUpdateInstanceExecute(r ApiPartialUpdateInstanceRequest) (*PartialUpdateInstanceResponse, error) + + /* + PartialUpdateUser Update User + + Update user for an instance. Only the roles are updatable. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The ID of the project + @param instanceId The ID of the instance + @param userId The ID of the user in the database + @return ApiPartialUpdateUserRequest + */ + PartialUpdateUser(ctx context.Context, projectId string, instanceId string, userId string) ApiPartialUpdateUserRequest + + // PartialUpdateUserExecute executes the request + PartialUpdateUserExecute(r ApiPartialUpdateUserRequest) error + + /* + ResetUser Reset User + + Reset user password for a postgres instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param instanceId Instance ID + @param userId user ID + @return ApiResetUserRequest + */ + ResetUser(ctx context.Context, projectId string, instanceId string, userId string) ApiResetUserRequest + + // ResetUserExecute executes the request + // @return ResetUserResponse + ResetUserExecute(r ApiResetUserRequest) (*ResetUserResponse, error) + + /* + UpdateBackupSchedule Update Backup Schedule + + Update backup schedule + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param instanceId Instance ID + @return ApiUpdateBackupScheduleRequest + */ + UpdateBackupSchedule(ctx context.Context, projectId string, instanceId string) ApiUpdateBackupScheduleRequest + + // UpdateBackupScheduleExecute executes the request + UpdateBackupScheduleExecute(r ApiUpdateBackupScheduleRequest) error + + /* + UpdateInstance Update Instance + + Update available instance of a postgres database. Supported Versions are 12, 13, 14, 15 -- only upgrades are allowed! + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param instanceId Instance ID + @return ApiUpdateInstanceRequest + */ + UpdateInstance(ctx context.Context, projectId string, instanceId string) ApiUpdateInstanceRequest + + // UpdateInstanceExecute executes the request + // @return PartialUpdateInstanceResponse + UpdateInstanceExecute(r ApiUpdateInstanceRequest) (*PartialUpdateInstanceResponse, error) + + /* + UpdateUser Update User + + Update user for an instance. Only the roles are updatable. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The ID of the project + @param instanceId The ID of the instance + @param userId The ID of the user in the database + @return ApiUpdateUserRequest + */ + UpdateUser(ctx context.Context, projectId string, instanceId string, userId string) ApiUpdateUserRequest + + // UpdateUserExecute executes the request + UpdateUserExecute(r ApiUpdateUserRequest) error +} + +// DefaultAPIService DefaultAPI service +type DefaultAPIService service + +type ApiCloneInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + cloneInstancePayload *CloneInstancePayload +} + +// Body +func (r ApiCloneInstanceRequest) CloneInstancePayload(cloneInstancePayload CloneInstancePayload) ApiCloneInstanceRequest { + r.cloneInstancePayload = &cloneInstancePayload + return r +} + +func (r ApiCloneInstanceRequest) Execute() (*CloneInstanceResponse, error) { + return r.ApiService.CloneInstanceExecute(r) +} + +/* +CloneInstance Clone Instance + +Clone an existing instance of a postgres database to a new destination instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param instanceId Instance ID + @return ApiCloneInstanceRequest +*/ +func (a *DefaultAPIService) CloneInstance(ctx context.Context, projectId string, instanceId string) ApiCloneInstanceRequest { + return ApiCloneInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return CloneInstanceResponse +func (a *DefaultAPIService) CloneInstanceExecute(r ApiCloneInstanceRequest) (*CloneInstanceResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CloneInstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CloneInstance") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/clone" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.cloneInstancePayload == nil { + return localVarReturnValue, reportError("cloneInstancePayload 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.cloneInstancePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateDatabaseRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + createDatabasePayload *CreateDatabasePayload +} + +// body +func (r ApiCreateDatabaseRequest) CreateDatabasePayload(createDatabasePayload CreateDatabasePayload) ApiCreateDatabaseRequest { + r.createDatabasePayload = &createDatabasePayload + return r +} + +func (r ApiCreateDatabaseRequest) Execute() (*InstanceCreateDatabaseResponse, error) { + return r.ApiService.CreateDatabaseExecute(r) +} + +/* +CreateDatabase Create Database + +Create database for a user +Note: The name of a valid user must be provided in the "options" map field using the key "owner" + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param instanceId Instance ID + @return ApiCreateDatabaseRequest +*/ +func (a *DefaultAPIService) CreateDatabase(ctx context.Context, projectId string, instanceId string) ApiCreateDatabaseRequest { + return ApiCreateDatabaseRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return InstanceCreateDatabaseResponse +func (a *DefaultAPIService) CreateDatabaseExecute(r ApiCreateDatabaseRequest) (*InstanceCreateDatabaseResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InstanceCreateDatabaseResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateDatabase") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/databases" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createDatabasePayload == nil { + return localVarReturnValue, reportError("createDatabasePayload 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.createDatabasePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + createInstancePayload *CreateInstancePayload +} + +// Body +func (r ApiCreateInstanceRequest) CreateInstancePayload(createInstancePayload CreateInstancePayload) ApiCreateInstanceRequest { + r.createInstancePayload = &createInstancePayload + return r +} + +func (r ApiCreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { + return r.ApiService.CreateInstanceExecute(r) +} + +/* +CreateInstance Create Instance + +Create a new instance of a postgres database + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @return ApiCreateInstanceRequest +*/ +func (a *DefaultAPIService) CreateInstance(ctx context.Context, projectId string) ApiCreateInstanceRequest { + return ApiCreateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return CreateInstanceResponse +func (a *DefaultAPIService) CreateInstanceExecute(r ApiCreateInstanceRequest) (*CreateInstanceResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateInstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateInstance") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createInstancePayload == nil { + return localVarReturnValue, reportError("createInstancePayload 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.createInstancePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateUserRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + createUserPayload *CreateUserPayload +} + +// body +func (r ApiCreateUserRequest) CreateUserPayload(createUserPayload CreateUserPayload) ApiCreateUserRequest { + r.createUserPayload = &createUserPayload + return r +} + +func (r ApiCreateUserRequest) Execute() (*CreateUserResponse, error) { + return r.ApiService.CreateUserExecute(r) +} + +/* +CreateUser Create User + +Create user for an instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param instanceId Instance ID + @return ApiCreateUserRequest +*/ +func (a *DefaultAPIService) CreateUser(ctx context.Context, projectId string, instanceId string) ApiCreateUserRequest { + return ApiCreateUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return CreateUserResponse +func (a *DefaultAPIService) CreateUserExecute(r ApiCreateUserRequest) (*CreateUserResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateUserResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateUser") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/users" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createUserPayload == nil { + return localVarReturnValue, reportError("createUserPayload 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.createUserPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiDeleteDatabaseRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + databaseId string +} + +func (r ApiDeleteDatabaseRequest) Execute() error { + return r.ApiService.DeleteDatabaseExecute(r) +} + +/* +DeleteDatabase Delete Database + +Delete database for an instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param instanceId Instance ID + @param databaseId Database ID + @return ApiDeleteDatabaseRequest +*/ +func (a *DefaultAPIService) DeleteDatabase(ctx context.Context, projectId string, instanceId string, databaseId string) ApiDeleteDatabaseRequest { + return ApiDeleteDatabaseRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + databaseId: databaseId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteDatabaseExecute(r ApiDeleteDatabaseRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteDatabase") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/databases/{databaseId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"databaseId"+"}", url.PathEscape(parameterValueToString(r.databaseId, "databaseId")), -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 err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, 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 + } + return newErr + } + + return nil +} + +type ApiDeleteInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string +} + +func (r ApiDeleteInstanceRequest) Execute() error { + return r.ApiService.DeleteInstanceExecute(r) +} + +/* +DeleteInstance Delete Instance + +Delete available instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param instanceId Instance ID + @return ApiDeleteInstanceRequest +*/ +func (a *DefaultAPIService) DeleteInstance(ctx context.Context, projectId string, instanceId string) ApiDeleteInstanceRequest { + return ApiDeleteInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteInstanceExecute(r ApiDeleteInstanceRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteInstance") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -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 err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, 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 == 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 ApiDeleteUserRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + userId string +} + +func (r ApiDeleteUserRequest) Execute() error { + return r.ApiService.DeleteUserExecute(r) +} + +/* +DeleteUser Delete User + +Delete user for an instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param instanceId Instance ID + @param userId User ID + @return ApiDeleteUserRequest +*/ +func (a *DefaultAPIService) DeleteUser(ctx context.Context, projectId string, instanceId string, userId string) ApiDeleteUserRequest { + return ApiDeleteUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + userId: userId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteUserExecute(r ApiDeleteUserRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteUser") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/users/{userId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -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 err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, 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 + } + return newErr + } + + return nil +} + +type ApiForceDeleteInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string +} + +func (r ApiForceDeleteInstanceRequest) Execute() error { + return r.ApiService.ForceDeleteInstanceExecute(r) +} + +/* +ForceDeleteInstance Force delete instance + +Forces the deletion of an delayed deleted instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param instanceId Instance ID + @return ApiForceDeleteInstanceRequest +*/ +func (a *DefaultAPIService) ForceDeleteInstance(ctx context.Context, projectId string, instanceId string) ApiForceDeleteInstanceRequest { + return ApiForceDeleteInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) ForceDeleteInstanceExecute(r ApiForceDeleteInstanceRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ForceDeleteInstance") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/force" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -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 err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, 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 == 406 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != 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 ApiGetBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + backupId string +} + +func (r ApiGetBackupRequest) Execute() (*GetBackupResponse, error) { + return r.ApiService.GetBackupExecute(r) +} + +/* +GetBackup Get specific backup + +Get specific available backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param instanceId Instance ID + @param backupId Backup ID + @return ApiGetBackupRequest +*/ +func (a *DefaultAPIService) GetBackup(ctx context.Context, projectId string, instanceId string, backupId string) ApiGetBackupRequest { + return ApiGetBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + backupId: backupId, + } +} + +// Execute executes the request +// +// @return GetBackupResponse +func (a *DefaultAPIService) GetBackupExecute(r ApiGetBackupRequest) (*GetBackupResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetBackupResponse + ) + + 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}/instances/{instanceId}/backups/{backupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -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 + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string +} + +func (r ApiGetInstanceRequest) Execute() (*InstanceResponse, error) { + return r.ApiService.GetInstanceExecute(r) +} + +/* +GetInstance Get specific instance + +Get specific available instances + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param instanceId Instance ID + @return ApiGetInstanceRequest +*/ +func (a *DefaultAPIService) GetInstance(ctx context.Context, projectId string, instanceId string) ApiGetInstanceRequest { + return ApiGetInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return InstanceResponse +func (a *DefaultAPIService) GetInstanceExecute(r ApiGetInstanceRequest) (*InstanceResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetInstance") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -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 + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetUserRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + userId string +} + +func (r ApiGetUserRequest) Execute() (*GetUserResponse, error) { + return r.ApiService.GetUserExecute(r) +} + +/* +GetUser Get User + +Get specific available user for an instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param instanceId Instance ID + @param userId User ID + @return ApiGetUserRequest +*/ +func (a *DefaultAPIService) GetUser(ctx context.Context, projectId string, instanceId string, userId string) ApiGetUserRequest { + return ApiGetUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + userId: userId, + } +} + +// Execute executes the request +// +// @return GetUserResponse +func (a *DefaultAPIService) GetUserExecute(r ApiGetUserRequest) (*GetUserResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetUserResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetUser") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/users/{userId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -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 + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.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 + instanceId string +} + +func (r ApiListBackupsRequest) Execute() (*ListBackupsResponse, error) { + return r.ApiService.ListBackupsExecute(r) +} + +/* +ListBackups List backups + +List all backups which are available for a specific instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param instanceId Instance ID + @return ApiListBackupsRequest +*/ +func (a *DefaultAPIService) ListBackups(ctx context.Context, projectId string, instanceId string) ApiListBackupsRequest { + return ApiListBackupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListBackupsResponse +func (a *DefaultAPIService) ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListBackupsResponse + ) + + 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}/instances/{instanceId}/backups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -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 + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListDatabaseParametersRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string +} + +func (r ApiListDatabaseParametersRequest) Execute() (*PostgresDatabaseParameterResponse, error) { + return r.ApiService.ListDatabaseParametersExecute(r) +} + +/* +ListDatabaseParameters List Databases parameter + +List available databases parameter + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param instanceId Instance ID + @return ApiListDatabaseParametersRequest +*/ +func (a *DefaultAPIService) ListDatabaseParameters(ctx context.Context, projectId string, instanceId string) ApiListDatabaseParametersRequest { + return ApiListDatabaseParametersRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return PostgresDatabaseParameterResponse +func (a *DefaultAPIService) ListDatabaseParametersExecute(r ApiListDatabaseParametersRequest) (*PostgresDatabaseParameterResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PostgresDatabaseParameterResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListDatabaseParameters") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/parameter" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -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 + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListDatabasesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string +} + +func (r ApiListDatabasesRequest) Execute() (*InstanceListDatabasesResponse, error) { + return r.ApiService.ListDatabasesExecute(r) +} + +/* +ListDatabases List Databases + +List available databases for an instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param instanceId Instance ID + @return ApiListDatabasesRequest +*/ +func (a *DefaultAPIService) ListDatabases(ctx context.Context, projectId string, instanceId string) ApiListDatabasesRequest { + return ApiListDatabasesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return InstanceListDatabasesResponse +func (a *DefaultAPIService) ListDatabasesExecute(r ApiListDatabasesRequest) (*InstanceListDatabasesResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InstanceListDatabasesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListDatabases") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/databases" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -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 + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListFlavorsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string +} + +func (r ApiListFlavorsRequest) Execute() (*ListFlavorsResponse, error) { + return r.ApiService.ListFlavorsExecute(r) +} + +/* +ListFlavors Get Flavors + +Get available flavors for a specific projectID + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @return ApiListFlavorsRequest +*/ +func (a *DefaultAPIService) ListFlavors(ctx context.Context, projectId string) ApiListFlavorsRequest { + return ApiListFlavorsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return ListFlavorsResponse +func (a *DefaultAPIService) ListFlavorsExecute(r ApiListFlavorsRequest) (*ListFlavorsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListFlavorsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListFlavors") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/flavors" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -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 + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListInstancesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string +} + +func (r ApiListInstancesRequest) Execute() (*ListInstancesResponse, error) { + return r.ApiService.ListInstancesExecute(r) +} + +/* +ListInstances List Instances + +List available instances + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @return ApiListInstancesRequest +*/ +func (a *DefaultAPIService) ListInstances(ctx context.Context, projectId string) ApiListInstancesRequest { + return ApiListInstancesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return ListInstancesResponse +func (a *DefaultAPIService) ListInstancesExecute(r ApiListInstancesRequest) (*ListInstancesResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListInstancesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListInstances") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -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 + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListMetricsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + metric string + granularity *string + period *string + start *string + end *string +} + +// The granularity in ISO8601 e.g. 5 minutes are 'PT5M'. +func (r ApiListMetricsRequest) Granularity(granularity string) ApiListMetricsRequest { + r.granularity = &granularity + return r +} + +// The period in ISO8601 format e.g. 5 minutes are 'PT5M'. If no period is provided, the standard value of 5 minutes is used. +func (r ApiListMetricsRequest) Period(period string) ApiListMetricsRequest { + r.period = &period + return r +} + +// The start of the timeframe as timestamp in ISO8601 (RFC3339) e.g. '2023-08-28T07:10:52.536Z'. If no start time is provided, current server time as UTC is used. +func (r ApiListMetricsRequest) Start(start string) ApiListMetricsRequest { + r.start = &start + return r +} + +// The end of the timeframe as timestamp in ISO8601 (RFC3339) e.g. '2023-08-28T07:10:52.536Z'. +func (r ApiListMetricsRequest) End(end string) ApiListMetricsRequest { + r.end = &end + return r +} + +func (r ApiListMetricsRequest) Execute() (*InstanceMetricsResponse, error) { + return r.ApiService.ListMetricsExecute(r) +} + +/* +ListMetrics Get Metric + +Returns a metric for an instance. The metric will only be for the master pod if needed. Granularity parameter is always needed. If start and end time is provided, period is not considered in connections and disk-use. If you provide start time, you have to provide end time as well and vice versa. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The UUID of the project. + @param instanceId The UUID of the instance. + @param metric The name of the metric. Valid metrics are 'cpu', 'memory', 'disk-use', 'disk-size' and 'connections'. + @return ApiListMetricsRequest +*/ +func (a *DefaultAPIService) ListMetrics(ctx context.Context, projectId string, instanceId string, metric string) ApiListMetricsRequest { + return ApiListMetricsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + metric: metric, + } +} + +// Execute executes the request +// +// @return InstanceMetricsResponse +func (a *DefaultAPIService) ListMetricsExecute(r ApiListMetricsRequest) (*InstanceMetricsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InstanceMetricsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListMetrics") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/metrics/{metric}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"metric"+"}", url.PathEscape(parameterValueToString(r.metric, "metric")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.granularity == nil { + return localVarReturnValue, reportError("granularity is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "granularity", r.granularity, "form", "") + if r.period != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "period", r.period, "form", "") + } + if r.start != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "start", r.start, "form", "") + } + if r.end != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "end", r.end, "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 == 405 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListStoragesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + flavorId string +} + +func (r ApiListStoragesRequest) Execute() (*ListStoragesResponse, error) { + return r.ApiService.ListStoragesExecute(r) +} + +/* +ListStorages Get Storages + +Get available storages for a specific flavor + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param flavorId Flavor ID + @return ApiListStoragesRequest +*/ +func (a *DefaultAPIService) ListStorages(ctx context.Context, projectId string, flavorId string) ApiListStoragesRequest { + return ApiListStoragesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + flavorId: flavorId, + } +} + +// Execute executes the request +// +// @return ListStoragesResponse +func (a *DefaultAPIService) ListStoragesExecute(r ApiListStoragesRequest) (*ListStoragesResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListStoragesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListStorages") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/storages/{flavorId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"flavorId"+"}", url.PathEscape(parameterValueToString(r.flavorId, "flavorId")), -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 + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListUsersRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string +} + +func (r ApiListUsersRequest) Execute() (*ListUsersResponse, error) { + return r.ApiService.ListUsersExecute(r) +} + +/* +ListUsers List Users + +List available users for an instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param instanceId Instance ID + @return ApiListUsersRequest +*/ +func (a *DefaultAPIService) ListUsers(ctx context.Context, projectId string, instanceId string) ApiListUsersRequest { + return ApiListUsersRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListUsersResponse +func (a *DefaultAPIService) ListUsersExecute(r ApiListUsersRequest) (*ListUsersResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListUsersResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListUsers") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/users" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -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 + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListVersionsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId *string +} + +// Instance ID +func (r ApiListVersionsRequest) InstanceId(instanceId string) ApiListVersionsRequest { + r.instanceId = &instanceId + return r +} + +func (r ApiListVersionsRequest) Execute() (*ListVersionsResponse, error) { + return r.ApiService.ListVersionsExecute(r) +} + +/* +ListVersions Get Versions + +Get available versions for postgres database + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @return ApiListVersionsRequest +*/ +func (a *DefaultAPIService) ListVersions(ctx context.Context, projectId string) ApiListVersionsRequest { + return ApiListVersionsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return ListVersionsResponse +func (a *DefaultAPIService) ListVersionsExecute(r ApiListVersionsRequest) (*ListVersionsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListVersionsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListVersions") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/versions" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.instanceId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "instanceId", r.instanceId, "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 + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiPartialUpdateInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + partialUpdateInstancePayload *PartialUpdateInstancePayload +} + +// Body +func (r ApiPartialUpdateInstanceRequest) PartialUpdateInstancePayload(partialUpdateInstancePayload PartialUpdateInstancePayload) ApiPartialUpdateInstanceRequest { + r.partialUpdateInstancePayload = &partialUpdateInstancePayload + return r +} + +func (r ApiPartialUpdateInstanceRequest) Execute() (*PartialUpdateInstanceResponse, error) { + return r.ApiService.PartialUpdateInstanceExecute(r) +} + +/* +PartialUpdateInstance Update Instance + +Update available instance of a postgres database. Supported Versions are 12, 13, 14, 15 -- only upgrades are allowed! + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param instanceId Instance ID + @return ApiPartialUpdateInstanceRequest +*/ +func (a *DefaultAPIService) PartialUpdateInstance(ctx context.Context, projectId string, instanceId string) ApiPartialUpdateInstanceRequest { + return ApiPartialUpdateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return PartialUpdateInstanceResponse +func (a *DefaultAPIService) PartialUpdateInstanceExecute(r ApiPartialUpdateInstanceRequest) (*PartialUpdateInstanceResponse, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PartialUpdateInstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PartialUpdateInstance") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.partialUpdateInstancePayload == nil { + return localVarReturnValue, reportError("partialUpdateInstancePayload 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.partialUpdateInstancePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiPartialUpdateUserRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + userId string + partialUpdateUserPayload *PartialUpdateUserPayload +} + +// The Request body only required in PUT endpoint. If empty request body is send via patch, then login and createdb roles are removed from user. The field +func (r ApiPartialUpdateUserRequest) PartialUpdateUserPayload(partialUpdateUserPayload PartialUpdateUserPayload) ApiPartialUpdateUserRequest { + r.partialUpdateUserPayload = &partialUpdateUserPayload + return r +} + +func (r ApiPartialUpdateUserRequest) Execute() error { + return r.ApiService.PartialUpdateUserExecute(r) +} + +/* +PartialUpdateUser Update User + +Update user for an instance. Only the roles are updatable. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The ID of the project + @param instanceId The ID of the instance + @param userId The ID of the user in the database + @return ApiPartialUpdateUserRequest +*/ +func (a *DefaultAPIService) PartialUpdateUser(ctx context.Context, projectId string, instanceId string, userId string) ApiPartialUpdateUserRequest { + return ApiPartialUpdateUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + userId: userId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) PartialUpdateUserExecute(r ApiPartialUpdateUserRequest) error { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PartialUpdateUser") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/users/{userId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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.partialUpdateUserPayload + 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 == 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 ApiResetUserRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + userId string +} + +func (r ApiResetUserRequest) Execute() (*ResetUserResponse, error) { + return r.ApiService.ResetUserExecute(r) +} + +/* +ResetUser Reset User + +Reset user password for a postgres instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param instanceId Instance ID + @param userId user ID + @return ApiResetUserRequest +*/ +func (a *DefaultAPIService) ResetUser(ctx context.Context, projectId string, instanceId string, userId string) ApiResetUserRequest { + return ApiResetUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + userId: userId, + } +} + +// Execute executes the request +// +// @return ResetUserResponse +func (a *DefaultAPIService) ResetUserExecute(r ApiResetUserRequest) (*ResetUserResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ResetUserResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ResetUser") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/users/{userId}/reset" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -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 == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateBackupScheduleRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + updateBackupSchedulePayload *UpdateBackupSchedulePayload +} + +// Body +func (r ApiUpdateBackupScheduleRequest) UpdateBackupSchedulePayload(updateBackupSchedulePayload UpdateBackupSchedulePayload) ApiUpdateBackupScheduleRequest { + r.updateBackupSchedulePayload = &updateBackupSchedulePayload + return r +} + +func (r ApiUpdateBackupScheduleRequest) Execute() error { + return r.ApiService.UpdateBackupScheduleExecute(r) +} + +/* +UpdateBackupSchedule Update Backup Schedule + +Update backup schedule + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param instanceId Instance ID + @return ApiUpdateBackupScheduleRequest +*/ +func (a *DefaultAPIService) UpdateBackupSchedule(ctx context.Context, projectId string, instanceId string) ApiUpdateBackupScheduleRequest { + return ApiUpdateBackupScheduleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) UpdateBackupScheduleExecute(r ApiUpdateBackupScheduleRequest) error { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateBackupSchedule") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateBackupSchedulePayload == nil { + return reportError("updateBackupSchedulePayload 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.updateBackupSchedulePayload + 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 + } + return newErr + } + + return nil +} + +type ApiUpdateInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + updateInstancePayload *UpdateInstancePayload +} + +// Body +func (r ApiUpdateInstanceRequest) UpdateInstancePayload(updateInstancePayload UpdateInstancePayload) ApiUpdateInstanceRequest { + r.updateInstancePayload = &updateInstancePayload + return r +} + +func (r ApiUpdateInstanceRequest) Execute() (*PartialUpdateInstanceResponse, error) { + return r.ApiService.UpdateInstanceExecute(r) +} + +/* +UpdateInstance Update Instance + +Update available instance of a postgres database. Supported Versions are 12, 13, 14, 15 -- only upgrades are allowed! + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param instanceId Instance ID + @return ApiUpdateInstanceRequest +*/ +func (a *DefaultAPIService) UpdateInstance(ctx context.Context, projectId string, instanceId string) ApiUpdateInstanceRequest { + return ApiUpdateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return PartialUpdateInstanceResponse +func (a *DefaultAPIService) UpdateInstanceExecute(r ApiUpdateInstanceRequest) (*PartialUpdateInstanceResponse, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PartialUpdateInstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateInstance") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateInstancePayload == nil { + return localVarReturnValue, reportError("updateInstancePayload 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.updateInstancePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateUserRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + userId string + updateUserPayload *UpdateUserPayload +} + +// The Request body only required in PUT endpoint. If empty request body is send via patch, then login and createdb roles are removed from user. The field +func (r ApiUpdateUserRequest) UpdateUserPayload(updateUserPayload UpdateUserPayload) ApiUpdateUserRequest { + r.updateUserPayload = &updateUserPayload + return r +} + +func (r ApiUpdateUserRequest) Execute() error { + return r.ApiService.UpdateUserExecute(r) +} + +/* +UpdateUser Update User + +Update user for an instance. Only the roles are updatable. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The ID of the project + @param instanceId The ID of the instance + @param userId The ID of the user in the database + @return ApiUpdateUserRequest +*/ +func (a *DefaultAPIService) UpdateUser(ctx context.Context, projectId string, instanceId string, userId string) ApiUpdateUserRequest { + return ApiUpdateUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + userId: userId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) UpdateUserExecute(r ApiUpdateUserRequest) error { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateUser") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/users/{userId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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.updateUserPayload + 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 == 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 +} diff --git a/services/postgresflex/v1api/api_default_mock.go b/services/postgresflex/v1api/api_default_mock.go new file mode 100644 index 000000000..eaf153c1f --- /dev/null +++ b/services/postgresflex/v1api/api_default_mock.go @@ -0,0 +1,567 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// 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 { + // CloneInstanceExecuteMock can be populated to implement the behavior of the CloneInstanceExecute function of this mock + CloneInstanceExecuteMock *func(r ApiCloneInstanceRequest) (*CloneInstanceResponse, error) + // CreateDatabaseExecuteMock can be populated to implement the behavior of the CreateDatabaseExecute function of this mock + CreateDatabaseExecuteMock *func(r ApiCreateDatabaseRequest) (*InstanceCreateDatabaseResponse, error) + // CreateInstanceExecuteMock can be populated to implement the behavior of the CreateInstanceExecute function of this mock + CreateInstanceExecuteMock *func(r ApiCreateInstanceRequest) (*CreateInstanceResponse, error) + // CreateUserExecuteMock can be populated to implement the behavior of the CreateUserExecute function of this mock + CreateUserExecuteMock *func(r ApiCreateUserRequest) (*CreateUserResponse, error) + // DeleteDatabaseExecuteMock can be populated to implement the behavior of the DeleteDatabaseExecute function of this mock + DeleteDatabaseExecuteMock *func(r ApiDeleteDatabaseRequest) error + // DeleteInstanceExecuteMock can be populated to implement the behavior of the DeleteInstanceExecute function of this mock + DeleteInstanceExecuteMock *func(r ApiDeleteInstanceRequest) error + // DeleteUserExecuteMock can be populated to implement the behavior of the DeleteUserExecute function of this mock + DeleteUserExecuteMock *func(r ApiDeleteUserRequest) error + // ForceDeleteInstanceExecuteMock can be populated to implement the behavior of the ForceDeleteInstanceExecute function of this mock + ForceDeleteInstanceExecuteMock *func(r ApiForceDeleteInstanceRequest) error + // GetBackupExecuteMock can be populated to implement the behavior of the GetBackupExecute function of this mock + GetBackupExecuteMock *func(r ApiGetBackupRequest) (*GetBackupResponse, error) + // GetInstanceExecuteMock can be populated to implement the behavior of the GetInstanceExecute function of this mock + GetInstanceExecuteMock *func(r ApiGetInstanceRequest) (*InstanceResponse, error) + // GetUserExecuteMock can be populated to implement the behavior of the GetUserExecute function of this mock + GetUserExecuteMock *func(r ApiGetUserRequest) (*GetUserResponse, error) + // ListBackupsExecuteMock can be populated to implement the behavior of the ListBackupsExecute function of this mock + ListBackupsExecuteMock *func(r ApiListBackupsRequest) (*ListBackupsResponse, error) + // ListDatabaseParametersExecuteMock can be populated to implement the behavior of the ListDatabaseParametersExecute function of this mock + ListDatabaseParametersExecuteMock *func(r ApiListDatabaseParametersRequest) (*PostgresDatabaseParameterResponse, error) + // ListDatabasesExecuteMock can be populated to implement the behavior of the ListDatabasesExecute function of this mock + ListDatabasesExecuteMock *func(r ApiListDatabasesRequest) (*InstanceListDatabasesResponse, error) + // ListFlavorsExecuteMock can be populated to implement the behavior of the ListFlavorsExecute function of this mock + ListFlavorsExecuteMock *func(r ApiListFlavorsRequest) (*ListFlavorsResponse, error) + // ListInstancesExecuteMock can be populated to implement the behavior of the ListInstancesExecute function of this mock + ListInstancesExecuteMock *func(r ApiListInstancesRequest) (*ListInstancesResponse, error) + // ListMetricsExecuteMock can be populated to implement the behavior of the ListMetricsExecute function of this mock + ListMetricsExecuteMock *func(r ApiListMetricsRequest) (*InstanceMetricsResponse, error) + // ListStoragesExecuteMock can be populated to implement the behavior of the ListStoragesExecute function of this mock + ListStoragesExecuteMock *func(r ApiListStoragesRequest) (*ListStoragesResponse, error) + // ListUsersExecuteMock can be populated to implement the behavior of the ListUsersExecute function of this mock + ListUsersExecuteMock *func(r ApiListUsersRequest) (*ListUsersResponse, error) + // ListVersionsExecuteMock can be populated to implement the behavior of the ListVersionsExecute function of this mock + ListVersionsExecuteMock *func(r ApiListVersionsRequest) (*ListVersionsResponse, error) + // PartialUpdateInstanceExecuteMock can be populated to implement the behavior of the PartialUpdateInstanceExecute function of this mock + PartialUpdateInstanceExecuteMock *func(r ApiPartialUpdateInstanceRequest) (*PartialUpdateInstanceResponse, error) + // PartialUpdateUserExecuteMock can be populated to implement the behavior of the PartialUpdateUserExecute function of this mock + PartialUpdateUserExecuteMock *func(r ApiPartialUpdateUserRequest) error + // ResetUserExecuteMock can be populated to implement the behavior of the ResetUserExecute function of this mock + ResetUserExecuteMock *func(r ApiResetUserRequest) (*ResetUserResponse, error) + // UpdateBackupScheduleExecuteMock can be populated to implement the behavior of the UpdateBackupScheduleExecute function of this mock + UpdateBackupScheduleExecuteMock *func(r ApiUpdateBackupScheduleRequest) error + // UpdateInstanceExecuteMock can be populated to implement the behavior of the UpdateInstanceExecute function of this mock + UpdateInstanceExecuteMock *func(r ApiUpdateInstanceRequest) (*PartialUpdateInstanceResponse, error) + // UpdateUserExecuteMock can be populated to implement the behavior of the UpdateUserExecute function of this mock + UpdateUserExecuteMock *func(r ApiUpdateUserRequest) error +} + +func (a DefaultAPIServiceMock) CloneInstance(ctx context.Context, projectId string, instanceId string) ApiCloneInstanceRequest { + return ApiCloneInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// CloneInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CloneInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CloneInstanceExecute(r ApiCloneInstanceRequest) (*CloneInstanceResponse, error) { + if a.CloneInstanceExecuteMock == nil { + var localVarReturnValue *CloneInstanceResponse + return localVarReturnValue, nil + } + + return (*a.CloneInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateDatabase(ctx context.Context, projectId string, instanceId string) ApiCreateDatabaseRequest { + return ApiCreateDatabaseRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// CreateDatabaseExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateDatabaseExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateDatabaseExecute(r ApiCreateDatabaseRequest) (*InstanceCreateDatabaseResponse, error) { + if a.CreateDatabaseExecuteMock == nil { + var localVarReturnValue *InstanceCreateDatabaseResponse + return localVarReturnValue, nil + } + + return (*a.CreateDatabaseExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateInstance(ctx context.Context, projectId string) ApiCreateInstanceRequest { + return ApiCreateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// CreateInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateInstanceExecute(r ApiCreateInstanceRequest) (*CreateInstanceResponse, error) { + if a.CreateInstanceExecuteMock == nil { + var localVarReturnValue *CreateInstanceResponse + return localVarReturnValue, nil + } + + return (*a.CreateInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateUser(ctx context.Context, projectId string, instanceId string) ApiCreateUserRequest { + return ApiCreateUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// CreateUserExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateUserExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateUserExecute(r ApiCreateUserRequest) (*CreateUserResponse, error) { + if a.CreateUserExecuteMock == nil { + var localVarReturnValue *CreateUserResponse + return localVarReturnValue, nil + } + + return (*a.CreateUserExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteDatabase(ctx context.Context, projectId string, instanceId string, databaseId string) ApiDeleteDatabaseRequest { + return ApiDeleteDatabaseRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + databaseId: databaseId, + } +} + +// DeleteDatabaseExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteDatabaseExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteDatabaseExecute(r ApiDeleteDatabaseRequest) error { + if a.DeleteDatabaseExecuteMock == nil { + return nil + } + + return (*a.DeleteDatabaseExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteInstance(ctx context.Context, projectId string, instanceId string) ApiDeleteInstanceRequest { + return ApiDeleteInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// DeleteInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteInstanceExecute(r ApiDeleteInstanceRequest) error { + if a.DeleteInstanceExecuteMock == nil { + return nil + } + + return (*a.DeleteInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteUser(ctx context.Context, projectId string, instanceId string, userId string) ApiDeleteUserRequest { + return ApiDeleteUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + userId: userId, + } +} + +// DeleteUserExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteUserExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteUserExecute(r ApiDeleteUserRequest) error { + if a.DeleteUserExecuteMock == nil { + return nil + } + + return (*a.DeleteUserExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ForceDeleteInstance(ctx context.Context, projectId string, instanceId string) ApiForceDeleteInstanceRequest { + return ApiForceDeleteInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// ForceDeleteInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ForceDeleteInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ForceDeleteInstanceExecute(r ApiForceDeleteInstanceRequest) error { + if a.ForceDeleteInstanceExecuteMock == nil { + return nil + } + + return (*a.ForceDeleteInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetBackup(ctx context.Context, projectId string, instanceId string, backupId string) ApiGetBackupRequest { + return ApiGetBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + 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) (*GetBackupResponse, error) { + if a.GetBackupExecuteMock == nil { + var localVarReturnValue *GetBackupResponse + return localVarReturnValue, nil + } + + return (*a.GetBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetInstance(ctx context.Context, projectId string, instanceId string) ApiGetInstanceRequest { + return ApiGetInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// GetInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetInstanceExecute(r ApiGetInstanceRequest) (*InstanceResponse, error) { + if a.GetInstanceExecuteMock == nil { + var localVarReturnValue *InstanceResponse + return localVarReturnValue, nil + } + + return (*a.GetInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetUser(ctx context.Context, projectId string, instanceId string, userId string) ApiGetUserRequest { + return ApiGetUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + userId: userId, + } +} + +// GetUserExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetUserExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetUserExecute(r ApiGetUserRequest) (*GetUserResponse, error) { + if a.GetUserExecuteMock == nil { + var localVarReturnValue *GetUserResponse + return localVarReturnValue, nil + } + + return (*a.GetUserExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListBackups(ctx context.Context, projectId string, instanceId string) ApiListBackupsRequest { + return ApiListBackupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// 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) (*ListBackupsResponse, error) { + if a.ListBackupsExecuteMock == nil { + var localVarReturnValue *ListBackupsResponse + return localVarReturnValue, nil + } + + return (*a.ListBackupsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListDatabaseParameters(ctx context.Context, projectId string, instanceId string) ApiListDatabaseParametersRequest { + return ApiListDatabaseParametersRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// ListDatabaseParametersExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListDatabaseParametersExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListDatabaseParametersExecute(r ApiListDatabaseParametersRequest) (*PostgresDatabaseParameterResponse, error) { + if a.ListDatabaseParametersExecuteMock == nil { + var localVarReturnValue *PostgresDatabaseParameterResponse + return localVarReturnValue, nil + } + + return (*a.ListDatabaseParametersExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListDatabases(ctx context.Context, projectId string, instanceId string) ApiListDatabasesRequest { + return ApiListDatabasesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// ListDatabasesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListDatabasesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListDatabasesExecute(r ApiListDatabasesRequest) (*InstanceListDatabasesResponse, error) { + if a.ListDatabasesExecuteMock == nil { + var localVarReturnValue *InstanceListDatabasesResponse + return localVarReturnValue, nil + } + + return (*a.ListDatabasesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListFlavors(ctx context.Context, projectId string) ApiListFlavorsRequest { + return ApiListFlavorsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// ListFlavorsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListFlavorsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListFlavorsExecute(r ApiListFlavorsRequest) (*ListFlavorsResponse, error) { + if a.ListFlavorsExecuteMock == nil { + var localVarReturnValue *ListFlavorsResponse + return localVarReturnValue, nil + } + + return (*a.ListFlavorsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListInstances(ctx context.Context, projectId string) ApiListInstancesRequest { + return ApiListInstancesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// ListInstancesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListInstancesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListInstancesExecute(r ApiListInstancesRequest) (*ListInstancesResponse, error) { + if a.ListInstancesExecuteMock == nil { + var localVarReturnValue *ListInstancesResponse + return localVarReturnValue, nil + } + + return (*a.ListInstancesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListMetrics(ctx context.Context, projectId string, instanceId string, metric string) ApiListMetricsRequest { + return ApiListMetricsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + metric: metric, + } +} + +// ListMetricsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListMetricsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListMetricsExecute(r ApiListMetricsRequest) (*InstanceMetricsResponse, error) { + if a.ListMetricsExecuteMock == nil { + var localVarReturnValue *InstanceMetricsResponse + return localVarReturnValue, nil + } + + return (*a.ListMetricsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListStorages(ctx context.Context, projectId string, flavorId string) ApiListStoragesRequest { + return ApiListStoragesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + flavorId: flavorId, + } +} + +// ListStoragesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListStoragesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListStoragesExecute(r ApiListStoragesRequest) (*ListStoragesResponse, error) { + if a.ListStoragesExecuteMock == nil { + var localVarReturnValue *ListStoragesResponse + return localVarReturnValue, nil + } + + return (*a.ListStoragesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListUsers(ctx context.Context, projectId string, instanceId string) ApiListUsersRequest { + return ApiListUsersRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// ListUsersExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListUsersExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListUsersExecute(r ApiListUsersRequest) (*ListUsersResponse, error) { + if a.ListUsersExecuteMock == nil { + var localVarReturnValue *ListUsersResponse + return localVarReturnValue, nil + } + + return (*a.ListUsersExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListVersions(ctx context.Context, projectId string) ApiListVersionsRequest { + return ApiListVersionsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// ListVersionsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListVersionsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListVersionsExecute(r ApiListVersionsRequest) (*ListVersionsResponse, error) { + if a.ListVersionsExecuteMock == nil { + var localVarReturnValue *ListVersionsResponse + return localVarReturnValue, nil + } + + return (*a.ListVersionsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) PartialUpdateInstance(ctx context.Context, projectId string, instanceId string) ApiPartialUpdateInstanceRequest { + return ApiPartialUpdateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// PartialUpdateInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PartialUpdateInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) PartialUpdateInstanceExecute(r ApiPartialUpdateInstanceRequest) (*PartialUpdateInstanceResponse, error) { + if a.PartialUpdateInstanceExecuteMock == nil { + var localVarReturnValue *PartialUpdateInstanceResponse + return localVarReturnValue, nil + } + + return (*a.PartialUpdateInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) PartialUpdateUser(ctx context.Context, projectId string, instanceId string, userId string) ApiPartialUpdateUserRequest { + return ApiPartialUpdateUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + userId: userId, + } +} + +// PartialUpdateUserExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PartialUpdateUserExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) PartialUpdateUserExecute(r ApiPartialUpdateUserRequest) error { + if a.PartialUpdateUserExecuteMock == nil { + return nil + } + + return (*a.PartialUpdateUserExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ResetUser(ctx context.Context, projectId string, instanceId string, userId string) ApiResetUserRequest { + return ApiResetUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + userId: userId, + } +} + +// ResetUserExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ResetUserExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ResetUserExecute(r ApiResetUserRequest) (*ResetUserResponse, error) { + if a.ResetUserExecuteMock == nil { + var localVarReturnValue *ResetUserResponse + return localVarReturnValue, nil + } + + return (*a.ResetUserExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateBackupSchedule(ctx context.Context, projectId string, instanceId string) ApiUpdateBackupScheduleRequest { + return ApiUpdateBackupScheduleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// UpdateBackupScheduleExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateBackupScheduleExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateBackupScheduleExecute(r ApiUpdateBackupScheduleRequest) error { + if a.UpdateBackupScheduleExecuteMock == nil { + return nil + } + + return (*a.UpdateBackupScheduleExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateInstance(ctx context.Context, projectId string, instanceId string) ApiUpdateInstanceRequest { + return ApiUpdateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// UpdateInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateInstanceExecute(r ApiUpdateInstanceRequest) (*PartialUpdateInstanceResponse, error) { + if a.UpdateInstanceExecuteMock == nil { + var localVarReturnValue *PartialUpdateInstanceResponse + return localVarReturnValue, nil + } + + return (*a.UpdateInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateUser(ctx context.Context, projectId string, instanceId string, userId string) ApiUpdateUserRequest { + return ApiUpdateUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + userId: userId, + } +} + +// UpdateUserExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateUserExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateUserExecute(r ApiUpdateUserRequest) error { + if a.UpdateUserExecuteMock == nil { + return nil + } + + return (*a.UpdateUserExecuteMock)(r) +} diff --git a/services/postgresflex/v1api/client.go b/services/postgresflex/v1api/client.go new file mode 100644 index 000000000..55a6788db --- /dev/null +++ b/services/postgresflex/v1api/client.go @@ -0,0 +1,659 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// 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 PostgreSQL Flex API API v1.0.0 +// 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/postgresflex/v1api/configuration.go b/services/postgresflex/v1api/configuration.go new file mode 100644 index 000000000..3a8ad881d --- /dev/null +++ b/services/postgresflex/v1api/configuration.go @@ -0,0 +1,41 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// 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/postgresflex", + Debug: false, + Servers: config.ServerConfigurations{ + { + URL: "https://postgres-flex-service.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/postgresflex/v1api/model_acl.go b/services/postgresflex/v1api/model_acl.go new file mode 100644 index 000000000..abf8bf1c5 --- /dev/null +++ b/services/postgresflex/v1api/model_acl.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the ACL type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ACL{} + +// ACL struct for ACL +type ACL struct { + Items []string `json:"items,omitempty"` +} + +// NewACL instantiates a new ACL object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewACL() *ACL { + this := ACL{} + return &this +} + +// NewACLWithDefaults instantiates a new ACL object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewACLWithDefaults() *ACL { + this := ACL{} + return &this +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *ACL) GetItems() []string { + if o == nil || IsNil(o.Items) { + var ret []string + return ret + } + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ACL) GetItemsOk() ([]string, bool) { + if o == nil || IsNil(o.Items) { + return nil, false + } + return o.Items, true +} + +// HasItems returns a boolean if a field has been set. +func (o *ACL) HasItems() bool { + if o != nil && !IsNil(o.Items) { + return true + } + + return false +} + +// SetItems gets a reference to the given []string and assigns it to the Items field. +func (o *ACL) SetItems(v []string) { + o.Items = v +} + +func (o ACL) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ACL) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Items) { + toSerialize["items"] = o.Items + } + return toSerialize, nil +} + +type NullableACL struct { + value *ACL + isSet bool +} + +func (v NullableACL) Get() *ACL { + return v.value +} + +func (v *NullableACL) Set(val *ACL) { + v.value = val + v.isSet = true +} + +func (v NullableACL) IsSet() bool { + return v.isSet +} + +func (v *NullableACL) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableACL(val *ACL) *NullableACL { + return &NullableACL{value: val, isSet: true} +} + +func (v NullableACL) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableACL) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_api_configuration.go b/services/postgresflex/v1api/model_api_configuration.go new file mode 100644 index 000000000..46315c205 --- /dev/null +++ b/services/postgresflex/v1api/model_api_configuration.go @@ -0,0 +1,161 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the ApiConfiguration type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApiConfiguration{} + +// ApiConfiguration struct for ApiConfiguration +type ApiConfiguration struct { + Name *string `json:"name,omitempty"` + Setting *string `json:"setting,omitempty"` +} + +// NewApiConfiguration instantiates a new ApiConfiguration object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewApiConfiguration() *ApiConfiguration { + this := ApiConfiguration{} + return &this +} + +// NewApiConfigurationWithDefaults instantiates a new ApiConfiguration object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewApiConfigurationWithDefaults() *ApiConfiguration { + this := ApiConfiguration{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *ApiConfiguration) 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 *ApiConfiguration) 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 *ApiConfiguration) 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 *ApiConfiguration) SetName(v string) { + o.Name = &v +} + +// GetSetting returns the Setting field value if set, zero value otherwise. +func (o *ApiConfiguration) GetSetting() string { + if o == nil || IsNil(o.Setting) { + var ret string + return ret + } + return *o.Setting +} + +// GetSettingOk returns a tuple with the Setting field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApiConfiguration) GetSettingOk() (*string, bool) { + if o == nil || IsNil(o.Setting) { + return nil, false + } + return o.Setting, true +} + +// HasSetting returns a boolean if a field has been set. +func (o *ApiConfiguration) HasSetting() bool { + if o != nil && !IsNil(o.Setting) { + return true + } + + return false +} + +// SetSetting gets a reference to the given string and assigns it to the Setting field. +func (o *ApiConfiguration) SetSetting(v string) { + o.Setting = &v +} + +func (o ApiConfiguration) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApiConfiguration) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Setting) { + toSerialize["setting"] = o.Setting + } + return toSerialize, nil +} + +type NullableApiConfiguration struct { + value *ApiConfiguration + isSet bool +} + +func (v NullableApiConfiguration) Get() *ApiConfiguration { + return v.value +} + +func (v *NullableApiConfiguration) Set(val *ApiConfiguration) { + v.value = val + v.isSet = true +} + +func (v NullableApiConfiguration) IsSet() bool { + return v.isSet +} + +func (v *NullableApiConfiguration) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApiConfiguration(val *ApiConfiguration) *NullableApiConfiguration { + return &NullableApiConfiguration{value: val, isSet: true} +} + +func (v NullableApiConfiguration) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApiConfiguration) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_api_extension_config_load_response.go b/services/postgresflex/v1api/model_api_extension_config_load_response.go new file mode 100644 index 000000000..f5a85ed30 --- /dev/null +++ b/services/postgresflex/v1api/model_api_extension_config_load_response.go @@ -0,0 +1,126 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the ApiExtensionConfigLoadResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApiExtensionConfigLoadResponse{} + +// ApiExtensionConfigLoadResponse struct for ApiExtensionConfigLoadResponse +type ApiExtensionConfigLoadResponse struct { + // Returns marshalled JSON of the new configuration of whatever extension is called + Configuration []ApiConfiguration `json:"configuration,omitempty"` +} + +// NewApiExtensionConfigLoadResponse instantiates a new ApiExtensionConfigLoadResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewApiExtensionConfigLoadResponse() *ApiExtensionConfigLoadResponse { + this := ApiExtensionConfigLoadResponse{} + return &this +} + +// NewApiExtensionConfigLoadResponseWithDefaults instantiates a new ApiExtensionConfigLoadResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewApiExtensionConfigLoadResponseWithDefaults() *ApiExtensionConfigLoadResponse { + this := ApiExtensionConfigLoadResponse{} + return &this +} + +// GetConfiguration returns the Configuration field value if set, zero value otherwise. +func (o *ApiExtensionConfigLoadResponse) GetConfiguration() []ApiConfiguration { + if o == nil || IsNil(o.Configuration) { + var ret []ApiConfiguration + return ret + } + return o.Configuration +} + +// GetConfigurationOk returns a tuple with the Configuration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApiExtensionConfigLoadResponse) GetConfigurationOk() ([]ApiConfiguration, bool) { + if o == nil || IsNil(o.Configuration) { + return nil, false + } + return o.Configuration, true +} + +// HasConfiguration returns a boolean if a field has been set. +func (o *ApiExtensionConfigLoadResponse) HasConfiguration() bool { + if o != nil && !IsNil(o.Configuration) { + return true + } + + return false +} + +// SetConfiguration gets a reference to the given []ApiConfiguration and assigns it to the Configuration field. +func (o *ApiExtensionConfigLoadResponse) SetConfiguration(v []ApiConfiguration) { + o.Configuration = v +} + +func (o ApiExtensionConfigLoadResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApiExtensionConfigLoadResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Configuration) { + toSerialize["configuration"] = o.Configuration + } + return toSerialize, nil +} + +type NullableApiExtensionConfigLoadResponse struct { + value *ApiExtensionConfigLoadResponse + isSet bool +} + +func (v NullableApiExtensionConfigLoadResponse) Get() *ApiExtensionConfigLoadResponse { + return v.value +} + +func (v *NullableApiExtensionConfigLoadResponse) Set(val *ApiExtensionConfigLoadResponse) { + v.value = val + v.isSet = true +} + +func (v NullableApiExtensionConfigLoadResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableApiExtensionConfigLoadResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApiExtensionConfigLoadResponse(val *ApiExtensionConfigLoadResponse) *NullableApiExtensionConfigLoadResponse { + return &NullableApiExtensionConfigLoadResponse{value: val, isSet: true} +} + +func (v NullableApiExtensionConfigLoadResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApiExtensionConfigLoadResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_api_extension_configure_response.go b/services/postgresflex/v1api/model_api_extension_configure_response.go new file mode 100644 index 000000000..216c01c1e --- /dev/null +++ b/services/postgresflex/v1api/model_api_extension_configure_response.go @@ -0,0 +1,126 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the ApiExtensionConfigureResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApiExtensionConfigureResponse{} + +// ApiExtensionConfigureResponse struct for ApiExtensionConfigureResponse +type ApiExtensionConfigureResponse struct { + // Returns marshalled JSON of the new configuration of whatever extension is called + Configuration []ApiConfiguration `json:"configuration,omitempty"` +} + +// NewApiExtensionConfigureResponse instantiates a new ApiExtensionConfigureResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewApiExtensionConfigureResponse() *ApiExtensionConfigureResponse { + this := ApiExtensionConfigureResponse{} + return &this +} + +// NewApiExtensionConfigureResponseWithDefaults instantiates a new ApiExtensionConfigureResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewApiExtensionConfigureResponseWithDefaults() *ApiExtensionConfigureResponse { + this := ApiExtensionConfigureResponse{} + return &this +} + +// GetConfiguration returns the Configuration field value if set, zero value otherwise. +func (o *ApiExtensionConfigureResponse) GetConfiguration() []ApiConfiguration { + if o == nil || IsNil(o.Configuration) { + var ret []ApiConfiguration + return ret + } + return o.Configuration +} + +// GetConfigurationOk returns a tuple with the Configuration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApiExtensionConfigureResponse) GetConfigurationOk() ([]ApiConfiguration, bool) { + if o == nil || IsNil(o.Configuration) { + return nil, false + } + return o.Configuration, true +} + +// HasConfiguration returns a boolean if a field has been set. +func (o *ApiExtensionConfigureResponse) HasConfiguration() bool { + if o != nil && !IsNil(o.Configuration) { + return true + } + + return false +} + +// SetConfiguration gets a reference to the given []ApiConfiguration and assigns it to the Configuration field. +func (o *ApiExtensionConfigureResponse) SetConfiguration(v []ApiConfiguration) { + o.Configuration = v +} + +func (o ApiExtensionConfigureResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApiExtensionConfigureResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Configuration) { + toSerialize["configuration"] = o.Configuration + } + return toSerialize, nil +} + +type NullableApiExtensionConfigureResponse struct { + value *ApiExtensionConfigureResponse + isSet bool +} + +func (v NullableApiExtensionConfigureResponse) Get() *ApiExtensionConfigureResponse { + return v.value +} + +func (v *NullableApiExtensionConfigureResponse) Set(val *ApiExtensionConfigureResponse) { + v.value = val + v.isSet = true +} + +func (v NullableApiExtensionConfigureResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableApiExtensionConfigureResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApiExtensionConfigureResponse(val *ApiExtensionConfigureResponse) *NullableApiExtensionConfigureResponse { + return &NullableApiExtensionConfigureResponse{value: val, isSet: true} +} + +func (v NullableApiExtensionConfigureResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApiExtensionConfigureResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_api_extension_delete_response.go b/services/postgresflex/v1api/model_api_extension_delete_response.go new file mode 100644 index 000000000..caff60f57 --- /dev/null +++ b/services/postgresflex/v1api/model_api_extension_delete_response.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the ApiExtensionDeleteResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApiExtensionDeleteResponse{} + +// ApiExtensionDeleteResponse struct for ApiExtensionDeleteResponse +type ApiExtensionDeleteResponse struct { + IsSucceded *bool `json:"isSucceded,omitempty"` +} + +// NewApiExtensionDeleteResponse instantiates a new ApiExtensionDeleteResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewApiExtensionDeleteResponse() *ApiExtensionDeleteResponse { + this := ApiExtensionDeleteResponse{} + return &this +} + +// NewApiExtensionDeleteResponseWithDefaults instantiates a new ApiExtensionDeleteResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewApiExtensionDeleteResponseWithDefaults() *ApiExtensionDeleteResponse { + this := ApiExtensionDeleteResponse{} + return &this +} + +// GetIsSucceded returns the IsSucceded field value if set, zero value otherwise. +func (o *ApiExtensionDeleteResponse) GetIsSucceded() bool { + if o == nil || IsNil(o.IsSucceded) { + var ret bool + return ret + } + return *o.IsSucceded +} + +// GetIsSuccededOk returns a tuple with the IsSucceded field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApiExtensionDeleteResponse) GetIsSuccededOk() (*bool, bool) { + if o == nil || IsNil(o.IsSucceded) { + return nil, false + } + return o.IsSucceded, true +} + +// HasIsSucceded returns a boolean if a field has been set. +func (o *ApiExtensionDeleteResponse) HasIsSucceded() bool { + if o != nil && !IsNil(o.IsSucceded) { + return true + } + + return false +} + +// SetIsSucceded gets a reference to the given bool and assigns it to the IsSucceded field. +func (o *ApiExtensionDeleteResponse) SetIsSucceded(v bool) { + o.IsSucceded = &v +} + +func (o ApiExtensionDeleteResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApiExtensionDeleteResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.IsSucceded) { + toSerialize["isSucceded"] = o.IsSucceded + } + return toSerialize, nil +} + +type NullableApiExtensionDeleteResponse struct { + value *ApiExtensionDeleteResponse + isSet bool +} + +func (v NullableApiExtensionDeleteResponse) Get() *ApiExtensionDeleteResponse { + return v.value +} + +func (v *NullableApiExtensionDeleteResponse) Set(val *ApiExtensionDeleteResponse) { + v.value = val + v.isSet = true +} + +func (v NullableApiExtensionDeleteResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableApiExtensionDeleteResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApiExtensionDeleteResponse(val *ApiExtensionDeleteResponse) *NullableApiExtensionDeleteResponse { + return &NullableApiExtensionDeleteResponse{value: val, isSet: true} +} + +func (v NullableApiExtensionDeleteResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApiExtensionDeleteResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_api_extension_list.go b/services/postgresflex/v1api/model_api_extension_list.go new file mode 100644 index 000000000..68217f8c7 --- /dev/null +++ b/services/postgresflex/v1api/model_api_extension_list.go @@ -0,0 +1,197 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the ApiExtensionList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApiExtensionList{} + +// ApiExtensionList struct for ApiExtensionList +type ApiExtensionList struct { + ID *int32 `json:"ID,omitempty"` + Description *string `json:"description,omitempty"` + Name *string `json:"name,omitempty"` +} + +// NewApiExtensionList instantiates a new ApiExtensionList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewApiExtensionList() *ApiExtensionList { + this := ApiExtensionList{} + return &this +} + +// NewApiExtensionListWithDefaults instantiates a new ApiExtensionList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewApiExtensionListWithDefaults() *ApiExtensionList { + this := ApiExtensionList{} + return &this +} + +// GetID returns the ID field value if set, zero value otherwise. +func (o *ApiExtensionList) GetID() int32 { + if o == nil || IsNil(o.ID) { + var ret int32 + 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 *ApiExtensionList) GetIDOk() (*int32, 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 *ApiExtensionList) HasID() bool { + if o != nil && !IsNil(o.ID) { + return true + } + + return false +} + +// SetID gets a reference to the given int32 and assigns it to the ID field. +func (o *ApiExtensionList) SetID(v int32) { + o.ID = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ApiExtensionList) 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 *ApiExtensionList) 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 *ApiExtensionList) 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 *ApiExtensionList) SetDescription(v string) { + o.Description = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *ApiExtensionList) 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 *ApiExtensionList) 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 *ApiExtensionList) 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 *ApiExtensionList) SetName(v string) { + o.Name = &v +} + +func (o ApiExtensionList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApiExtensionList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ID) { + toSerialize["ID"] = o.ID + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + return toSerialize, nil +} + +type NullableApiExtensionList struct { + value *ApiExtensionList + isSet bool +} + +func (v NullableApiExtensionList) Get() *ApiExtensionList { + return v.value +} + +func (v *NullableApiExtensionList) Set(val *ApiExtensionList) { + v.value = val + v.isSet = true +} + +func (v NullableApiExtensionList) IsSet() bool { + return v.isSet +} + +func (v *NullableApiExtensionList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApiExtensionList(val *ApiExtensionList) *NullableApiExtensionList { + return &NullableApiExtensionList{value: val, isSet: true} +} + +func (v NullableApiExtensionList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApiExtensionList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_api_extension_load_response.go b/services/postgresflex/v1api/model_api_extension_load_response.go new file mode 100644 index 000000000..d651713e0 --- /dev/null +++ b/services/postgresflex/v1api/model_api_extension_load_response.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the ApiExtensionLoadResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApiExtensionLoadResponse{} + +// ApiExtensionLoadResponse struct for ApiExtensionLoadResponse +type ApiExtensionLoadResponse struct { + Extension *ApiExtensionList `json:"extension,omitempty"` +} + +// NewApiExtensionLoadResponse instantiates a new ApiExtensionLoadResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewApiExtensionLoadResponse() *ApiExtensionLoadResponse { + this := ApiExtensionLoadResponse{} + return &this +} + +// NewApiExtensionLoadResponseWithDefaults instantiates a new ApiExtensionLoadResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewApiExtensionLoadResponseWithDefaults() *ApiExtensionLoadResponse { + this := ApiExtensionLoadResponse{} + return &this +} + +// GetExtension returns the Extension field value if set, zero value otherwise. +func (o *ApiExtensionLoadResponse) GetExtension() ApiExtensionList { + if o == nil || IsNil(o.Extension) { + var ret ApiExtensionList + return ret + } + return *o.Extension +} + +// GetExtensionOk returns a tuple with the Extension field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApiExtensionLoadResponse) GetExtensionOk() (*ApiExtensionList, bool) { + if o == nil || IsNil(o.Extension) { + return nil, false + } + return o.Extension, true +} + +// HasExtension returns a boolean if a field has been set. +func (o *ApiExtensionLoadResponse) HasExtension() bool { + if o != nil && !IsNil(o.Extension) { + return true + } + + return false +} + +// SetExtension gets a reference to the given ApiExtensionList and assigns it to the Extension field. +func (o *ApiExtensionLoadResponse) SetExtension(v ApiExtensionList) { + o.Extension = &v +} + +func (o ApiExtensionLoadResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApiExtensionLoadResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Extension) { + toSerialize["extension"] = o.Extension + } + return toSerialize, nil +} + +type NullableApiExtensionLoadResponse struct { + value *ApiExtensionLoadResponse + isSet bool +} + +func (v NullableApiExtensionLoadResponse) Get() *ApiExtensionLoadResponse { + return v.value +} + +func (v *NullableApiExtensionLoadResponse) Set(val *ApiExtensionLoadResponse) { + v.value = val + v.isSet = true +} + +func (v NullableApiExtensionLoadResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableApiExtensionLoadResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApiExtensionLoadResponse(val *ApiExtensionLoadResponse) *NullableApiExtensionLoadResponse { + return &NullableApiExtensionLoadResponse{value: val, isSet: true} +} + +func (v NullableApiExtensionLoadResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApiExtensionLoadResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_api_install_response.go b/services/postgresflex/v1api/model_api_install_response.go new file mode 100644 index 000000000..b9d943569 --- /dev/null +++ b/services/postgresflex/v1api/model_api_install_response.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the ApiInstallResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApiInstallResponse{} + +// ApiInstallResponse struct for ApiInstallResponse +type ApiInstallResponse struct { + Extension *ApiExtensionList `json:"extension,omitempty"` +} + +// NewApiInstallResponse instantiates a new ApiInstallResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewApiInstallResponse() *ApiInstallResponse { + this := ApiInstallResponse{} + return &this +} + +// NewApiInstallResponseWithDefaults instantiates a new ApiInstallResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewApiInstallResponseWithDefaults() *ApiInstallResponse { + this := ApiInstallResponse{} + return &this +} + +// GetExtension returns the Extension field value if set, zero value otherwise. +func (o *ApiInstallResponse) GetExtension() ApiExtensionList { + if o == nil || IsNil(o.Extension) { + var ret ApiExtensionList + return ret + } + return *o.Extension +} + +// GetExtensionOk returns a tuple with the Extension field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApiInstallResponse) GetExtensionOk() (*ApiExtensionList, bool) { + if o == nil || IsNil(o.Extension) { + return nil, false + } + return o.Extension, true +} + +// HasExtension returns a boolean if a field has been set. +func (o *ApiInstallResponse) HasExtension() bool { + if o != nil && !IsNil(o.Extension) { + return true + } + + return false +} + +// SetExtension gets a reference to the given ApiExtensionList and assigns it to the Extension field. +func (o *ApiInstallResponse) SetExtension(v ApiExtensionList) { + o.Extension = &v +} + +func (o ApiInstallResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApiInstallResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Extension) { + toSerialize["extension"] = o.Extension + } + return toSerialize, nil +} + +type NullableApiInstallResponse struct { + value *ApiInstallResponse + isSet bool +} + +func (v NullableApiInstallResponse) Get() *ApiInstallResponse { + return v.value +} + +func (v *NullableApiInstallResponse) Set(val *ApiInstallResponse) { + v.value = val + v.isSet = true +} + +func (v NullableApiInstallResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableApiInstallResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApiInstallResponse(val *ApiInstallResponse) *NullableApiInstallResponse { + return &NullableApiInstallResponse{value: val, isSet: true} +} + +func (v NullableApiInstallResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApiInstallResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_api_installed_list_response.go b/services/postgresflex/v1api/model_api_installed_list_response.go new file mode 100644 index 000000000..80ecc8a4b --- /dev/null +++ b/services/postgresflex/v1api/model_api_installed_list_response.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the ApiInstalledListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApiInstalledListResponse{} + +// ApiInstalledListResponse struct for ApiInstalledListResponse +type ApiInstalledListResponse struct { + Installed []ApiExtensionList `json:"installed,omitempty"` +} + +// NewApiInstalledListResponse instantiates a new ApiInstalledListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewApiInstalledListResponse() *ApiInstalledListResponse { + this := ApiInstalledListResponse{} + return &this +} + +// NewApiInstalledListResponseWithDefaults instantiates a new ApiInstalledListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewApiInstalledListResponseWithDefaults() *ApiInstalledListResponse { + this := ApiInstalledListResponse{} + return &this +} + +// GetInstalled returns the Installed field value if set, zero value otherwise. +func (o *ApiInstalledListResponse) GetInstalled() []ApiExtensionList { + if o == nil || IsNil(o.Installed) { + var ret []ApiExtensionList + return ret + } + return o.Installed +} + +// GetInstalledOk returns a tuple with the Installed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApiInstalledListResponse) GetInstalledOk() ([]ApiExtensionList, bool) { + if o == nil || IsNil(o.Installed) { + return nil, false + } + return o.Installed, true +} + +// HasInstalled returns a boolean if a field has been set. +func (o *ApiInstalledListResponse) HasInstalled() bool { + if o != nil && !IsNil(o.Installed) { + return true + } + + return false +} + +// SetInstalled gets a reference to the given []ApiExtensionList and assigns it to the Installed field. +func (o *ApiInstalledListResponse) SetInstalled(v []ApiExtensionList) { + o.Installed = v +} + +func (o ApiInstalledListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApiInstalledListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Installed) { + toSerialize["installed"] = o.Installed + } + return toSerialize, nil +} + +type NullableApiInstalledListResponse struct { + value *ApiInstalledListResponse + isSet bool +} + +func (v NullableApiInstalledListResponse) Get() *ApiInstalledListResponse { + return v.value +} + +func (v *NullableApiInstalledListResponse) Set(val *ApiInstalledListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableApiInstalledListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableApiInstalledListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApiInstalledListResponse(val *ApiInstalledListResponse) *NullableApiInstalledListResponse { + return &NullableApiInstalledListResponse{value: val, isSet: true} +} + +func (v NullableApiInstalledListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApiInstalledListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_backup.go b/services/postgresflex/v1api/model_backup.go new file mode 100644 index 000000000..a5ca1a4c1 --- /dev/null +++ b/services/postgresflex/v1api/model_backup.go @@ -0,0 +1,377 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the Backup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Backup{} + +// Backup struct for Backup +type Backup struct { + EndTime *string `json:"endTime,omitempty"` + Error *string `json:"error,omitempty"` + Id *string `json:"id,omitempty"` + Labels []string `json:"labels,omitempty"` + Name *string `json:"name,omitempty"` + Options *map[string]string `json:"options,omitempty"` + Size *int32 `json:"size,omitempty"` + StartTime *string `json:"startTime,omitempty"` +} + +// 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 +} + +// GetEndTime returns the EndTime field value if set, zero value otherwise. +func (o *Backup) GetEndTime() string { + if o == nil || IsNil(o.EndTime) { + var ret string + return ret + } + return *o.EndTime +} + +// GetEndTimeOk returns a tuple with the EndTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetEndTimeOk() (*string, bool) { + if o == nil || IsNil(o.EndTime) { + return nil, false + } + return o.EndTime, true +} + +// HasEndTime returns a boolean if a field has been set. +func (o *Backup) HasEndTime() bool { + if o != nil && !IsNil(o.EndTime) { + return true + } + + return false +} + +// SetEndTime gets a reference to the given string and assigns it to the EndTime field. +func (o *Backup) SetEndTime(v string) { + o.EndTime = &v +} + +// GetError returns the Error field value if set, zero value otherwise. +func (o *Backup) GetError() string { + if o == nil || IsNil(o.Error) { + var ret string + return ret + } + return *o.Error +} + +// GetErrorOk returns a tuple with the Error field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetErrorOk() (*string, bool) { + if o == nil || IsNil(o.Error) { + return nil, false + } + return o.Error, true +} + +// HasError returns a boolean if a field has been set. +func (o *Backup) HasError() bool { + if o != nil && !IsNil(o.Error) { + return true + } + + return false +} + +// SetError gets a reference to the given string and assigns it to the Error field. +func (o *Backup) SetError(v string) { + o.Error = &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() []string { + if o == nil || IsNil(o.Labels) { + var ret []string + 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() ([]string, bool) { + if o == nil || IsNil(o.Labels) { + return nil, 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 []string and assigns it to the Labels field. +func (o *Backup) SetLabels(v []string) { + 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 +} + +// GetOptions returns the Options field value if set, zero value otherwise. +func (o *Backup) GetOptions() map[string]string { + if o == nil || IsNil(o.Options) { + var ret map[string]string + return ret + } + return *o.Options +} + +// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetOptionsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Options) { + return nil, false + } + return o.Options, true +} + +// HasOptions returns a boolean if a field has been set. +func (o *Backup) HasOptions() bool { + if o != nil && !IsNil(o.Options) { + return true + } + + return false +} + +// SetOptions gets a reference to the given map[string]string and assigns it to the Options field. +func (o *Backup) SetOptions(v map[string]string) { + o.Options = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *Backup) GetSize() int32 { + if o == nil || IsNil(o.Size) { + var ret int32 + 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() (*int32, 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 int32 and assigns it to the Size field. +func (o *Backup) SetSize(v int32) { + o.Size = &v +} + +// GetStartTime returns the StartTime field value if set, zero value otherwise. +func (o *Backup) GetStartTime() string { + if o == nil || IsNil(o.StartTime) { + var ret string + return ret + } + return *o.StartTime +} + +// GetStartTimeOk returns a tuple with the StartTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetStartTimeOk() (*string, bool) { + if o == nil || IsNil(o.StartTime) { + return nil, false + } + return o.StartTime, true +} + +// HasStartTime returns a boolean if a field has been set. +func (o *Backup) HasStartTime() bool { + if o != nil && !IsNil(o.StartTime) { + return true + } + + return false +} + +// SetStartTime gets a reference to the given string and assigns it to the StartTime field. +func (o *Backup) SetStartTime(v string) { + o.StartTime = &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.EndTime) { + toSerialize["endTime"] = o.EndTime + } + if !IsNil(o.Error) { + toSerialize["error"] = o.Error + } + 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.Options) { + toSerialize["options"] = o.Options + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.StartTime) { + toSerialize["startTime"] = o.StartTime + } + 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/postgresflex/v1api/model_clone_instance_payload.go b/services/postgresflex/v1api/model_clone_instance_payload.go new file mode 100644 index 000000000..ccc81f6cc --- /dev/null +++ b/services/postgresflex/v1api/model_clone_instance_payload.go @@ -0,0 +1,198 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the CloneInstancePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CloneInstancePayload{} + +// CloneInstancePayload struct for CloneInstancePayload +type CloneInstancePayload struct { + Class *string `json:"class,omitempty"` + Size *int32 `json:"size,omitempty"` + // The timestamp should be specified in UTC time following the format provided in the example. + Timestamp *string `json:"timestamp,omitempty"` +} + +// NewCloneInstancePayload instantiates a new CloneInstancePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCloneInstancePayload() *CloneInstancePayload { + this := CloneInstancePayload{} + return &this +} + +// NewCloneInstancePayloadWithDefaults instantiates a new CloneInstancePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCloneInstancePayloadWithDefaults() *CloneInstancePayload { + this := CloneInstancePayload{} + return &this +} + +// GetClass returns the Class field value if set, zero value otherwise. +func (o *CloneInstancePayload) GetClass() string { + if o == nil || IsNil(o.Class) { + var ret string + return ret + } + return *o.Class +} + +// GetClassOk returns a tuple with the Class field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CloneInstancePayload) GetClassOk() (*string, bool) { + if o == nil || IsNil(o.Class) { + return nil, false + } + return o.Class, true +} + +// HasClass returns a boolean if a field has been set. +func (o *CloneInstancePayload) HasClass() bool { + if o != nil && !IsNil(o.Class) { + return true + } + + return false +} + +// SetClass gets a reference to the given string and assigns it to the Class field. +func (o *CloneInstancePayload) SetClass(v string) { + o.Class = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *CloneInstancePayload) GetSize() int32 { + if o == nil || IsNil(o.Size) { + var ret int32 + 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 *CloneInstancePayload) GetSizeOk() (*int32, 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 *CloneInstancePayload) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int32 and assigns it to the Size field. +func (o *CloneInstancePayload) SetSize(v int32) { + o.Size = &v +} + +// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +func (o *CloneInstancePayload) GetTimestamp() string { + if o == nil || IsNil(o.Timestamp) { + var ret string + return ret + } + return *o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CloneInstancePayload) GetTimestampOk() (*string, bool) { + if o == nil || IsNil(o.Timestamp) { + return nil, false + } + return o.Timestamp, true +} + +// HasTimestamp returns a boolean if a field has been set. +func (o *CloneInstancePayload) HasTimestamp() bool { + if o != nil && !IsNil(o.Timestamp) { + return true + } + + return false +} + +// SetTimestamp gets a reference to the given string and assigns it to the Timestamp field. +func (o *CloneInstancePayload) SetTimestamp(v string) { + o.Timestamp = &v +} + +func (o CloneInstancePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CloneInstancePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Class) { + toSerialize["class"] = o.Class + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.Timestamp) { + toSerialize["timestamp"] = o.Timestamp + } + return toSerialize, nil +} + +type NullableCloneInstancePayload struct { + value *CloneInstancePayload + isSet bool +} + +func (v NullableCloneInstancePayload) Get() *CloneInstancePayload { + return v.value +} + +func (v *NullableCloneInstancePayload) Set(val *CloneInstancePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCloneInstancePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCloneInstancePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCloneInstancePayload(val *CloneInstancePayload) *NullableCloneInstancePayload { + return &NullableCloneInstancePayload{value: val, isSet: true} +} + +func (v NullableCloneInstancePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCloneInstancePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_clone_instance_response.go b/services/postgresflex/v1api/model_clone_instance_response.go new file mode 100644 index 000000000..9d2703cba --- /dev/null +++ b/services/postgresflex/v1api/model_clone_instance_response.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the CloneInstanceResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CloneInstanceResponse{} + +// CloneInstanceResponse struct for CloneInstanceResponse +type CloneInstanceResponse struct { + InstanceId *string `json:"instanceId,omitempty"` +} + +// NewCloneInstanceResponse instantiates a new CloneInstanceResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCloneInstanceResponse() *CloneInstanceResponse { + this := CloneInstanceResponse{} + return &this +} + +// NewCloneInstanceResponseWithDefaults instantiates a new CloneInstanceResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCloneInstanceResponseWithDefaults() *CloneInstanceResponse { + this := CloneInstanceResponse{} + return &this +} + +// GetInstanceId returns the InstanceId field value if set, zero value otherwise. +func (o *CloneInstanceResponse) GetInstanceId() string { + if o == nil || IsNil(o.InstanceId) { + var ret string + return ret + } + return *o.InstanceId +} + +// GetInstanceIdOk returns a tuple with the InstanceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CloneInstanceResponse) GetInstanceIdOk() (*string, bool) { + if o == nil || IsNil(o.InstanceId) { + return nil, false + } + return o.InstanceId, true +} + +// HasInstanceId returns a boolean if a field has been set. +func (o *CloneInstanceResponse) HasInstanceId() bool { + if o != nil && !IsNil(o.InstanceId) { + return true + } + + return false +} + +// SetInstanceId gets a reference to the given string and assigns it to the InstanceId field. +func (o *CloneInstanceResponse) SetInstanceId(v string) { + o.InstanceId = &v +} + +func (o CloneInstanceResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CloneInstanceResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.InstanceId) { + toSerialize["instanceId"] = o.InstanceId + } + return toSerialize, nil +} + +type NullableCloneInstanceResponse struct { + value *CloneInstanceResponse + isSet bool +} + +func (v NullableCloneInstanceResponse) Get() *CloneInstanceResponse { + return v.value +} + +func (v *NullableCloneInstanceResponse) Set(val *CloneInstanceResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCloneInstanceResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCloneInstanceResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCloneInstanceResponse(val *CloneInstanceResponse) *NullableCloneInstanceResponse { + return &NullableCloneInstanceResponse{value: val, isSet: true} +} + +func (v NullableCloneInstanceResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCloneInstanceResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_create_database_payload.go b/services/postgresflex/v1api/model_create_database_payload.go new file mode 100644 index 000000000..305ded496 --- /dev/null +++ b/services/postgresflex/v1api/model_create_database_payload.go @@ -0,0 +1,162 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the CreateDatabasePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateDatabasePayload{} + +// CreateDatabasePayload struct for CreateDatabasePayload +type CreateDatabasePayload struct { + Name *string `json:"name,omitempty"` + // Database specific options + Options *map[string]string `json:"options,omitempty"` +} + +// NewCreateDatabasePayload instantiates a new CreateDatabasePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateDatabasePayload() *CreateDatabasePayload { + this := CreateDatabasePayload{} + return &this +} + +// NewCreateDatabasePayloadWithDefaults instantiates a new CreateDatabasePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateDatabasePayloadWithDefaults() *CreateDatabasePayload { + this := CreateDatabasePayload{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CreateDatabasePayload) 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 *CreateDatabasePayload) 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 *CreateDatabasePayload) 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 *CreateDatabasePayload) SetName(v string) { + o.Name = &v +} + +// GetOptions returns the Options field value if set, zero value otherwise. +func (o *CreateDatabasePayload) GetOptions() map[string]string { + if o == nil || IsNil(o.Options) { + var ret map[string]string + return ret + } + return *o.Options +} + +// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateDatabasePayload) GetOptionsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Options) { + return nil, false + } + return o.Options, true +} + +// HasOptions returns a boolean if a field has been set. +func (o *CreateDatabasePayload) HasOptions() bool { + if o != nil && !IsNil(o.Options) { + return true + } + + return false +} + +// SetOptions gets a reference to the given map[string]string and assigns it to the Options field. +func (o *CreateDatabasePayload) SetOptions(v map[string]string) { + o.Options = &v +} + +func (o CreateDatabasePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateDatabasePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Options) { + toSerialize["options"] = o.Options + } + return toSerialize, nil +} + +type NullableCreateDatabasePayload struct { + value *CreateDatabasePayload + isSet bool +} + +func (v NullableCreateDatabasePayload) Get() *CreateDatabasePayload { + return v.value +} + +func (v *NullableCreateDatabasePayload) Set(val *CreateDatabasePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateDatabasePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateDatabasePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateDatabasePayload(val *CreateDatabasePayload) *NullableCreateDatabasePayload { + return &NullableCreateDatabasePayload{value: val, isSet: true} +} + +func (v NullableCreateDatabasePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateDatabasePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_create_instance_payload.go b/services/postgresflex/v1api/model_create_instance_payload.go new file mode 100644 index 000000000..685fc2d99 --- /dev/null +++ b/services/postgresflex/v1api/model_create_instance_payload.go @@ -0,0 +1,390 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateInstancePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateInstancePayload{} + +// CreateInstancePayload struct for CreateInstancePayload +type CreateInstancePayload struct { + Acl ACL `json:"acl"` + BackupSchedule string `json:"backupSchedule"` + FlavorId string `json:"flavorId"` + // Labels field is not certain/clear + Labels *map[string]string `json:"labels,omitempty"` + Name string `json:"name"` + Options map[string]string `json:"options"` + Replicas int32 `json:"replicas"` + Storage Storage `json:"storage"` + Version string `json:"version"` +} + +type _CreateInstancePayload CreateInstancePayload + +// NewCreateInstancePayload instantiates a new CreateInstancePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateInstancePayload(acl ACL, backupSchedule string, flavorId string, name string, options map[string]string, replicas int32, storage Storage, version string) *CreateInstancePayload { + this := CreateInstancePayload{} + this.Acl = acl + this.BackupSchedule = backupSchedule + this.FlavorId = flavorId + this.Name = name + this.Options = options + this.Replicas = replicas + this.Storage = storage + this.Version = version + return &this +} + +// NewCreateInstancePayloadWithDefaults instantiates a new CreateInstancePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateInstancePayloadWithDefaults() *CreateInstancePayload { + this := CreateInstancePayload{} + return &this +} + +// GetAcl returns the Acl field value +func (o *CreateInstancePayload) GetAcl() ACL { + if o == nil { + var ret ACL + return ret + } + + return o.Acl +} + +// GetAclOk returns a tuple with the Acl field value +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetAclOk() (*ACL, bool) { + if o == nil { + return nil, false + } + return &o.Acl, true +} + +// SetAcl sets field value +func (o *CreateInstancePayload) SetAcl(v ACL) { + o.Acl = v +} + +// GetBackupSchedule returns the BackupSchedule field value +func (o *CreateInstancePayload) GetBackupSchedule() string { + if o == nil { + var ret string + return ret + } + + return o.BackupSchedule +} + +// GetBackupScheduleOk returns a tuple with the BackupSchedule field value +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetBackupScheduleOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BackupSchedule, true +} + +// SetBackupSchedule sets field value +func (o *CreateInstancePayload) SetBackupSchedule(v string) { + o.BackupSchedule = v +} + +// GetFlavorId returns the FlavorId field value +func (o *CreateInstancePayload) GetFlavorId() string { + if o == nil { + var ret string + return ret + } + + return o.FlavorId +} + +// GetFlavorIdOk returns a tuple with the FlavorId field value +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetFlavorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FlavorId, true +} + +// SetFlavorId sets field value +func (o *CreateInstancePayload) SetFlavorId(v string) { + o.FlavorId = v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateInstancePayload) GetLabels() map[string]string { + if o == nil || IsNil(o.Labels) { + var ret map[string]string + 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 *CreateInstancePayload) GetLabelsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Labels) { + return nil, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateInstancePayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *CreateInstancePayload) SetLabels(v map[string]string) { + o.Labels = &v +} + +// GetName returns the Name field value +func (o *CreateInstancePayload) 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 *CreateInstancePayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateInstancePayload) SetName(v string) { + o.Name = v +} + +// GetOptions returns the Options field value +func (o *CreateInstancePayload) GetOptions() map[string]string { + if o == nil { + var ret map[string]string + return ret + } + + return o.Options +} + +// GetOptionsOk returns a tuple with the Options field value +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetOptionsOk() (*map[string]string, bool) { + if o == nil { + return nil, false + } + return &o.Options, true +} + +// SetOptions sets field value +func (o *CreateInstancePayload) SetOptions(v map[string]string) { + o.Options = v +} + +// GetReplicas returns the Replicas field value +func (o *CreateInstancePayload) GetReplicas() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Replicas +} + +// GetReplicasOk returns a tuple with the Replicas field value +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetReplicasOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Replicas, true +} + +// SetReplicas sets field value +func (o *CreateInstancePayload) SetReplicas(v int32) { + o.Replicas = v +} + +// GetStorage returns the Storage field value +func (o *CreateInstancePayload) GetStorage() Storage { + if o == nil { + var ret Storage + return ret + } + + return o.Storage +} + +// GetStorageOk returns a tuple with the Storage field value +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetStorageOk() (*Storage, bool) { + if o == nil { + return nil, false + } + return &o.Storage, true +} + +// SetStorage sets field value +func (o *CreateInstancePayload) SetStorage(v Storage) { + o.Storage = v +} + +// GetVersion returns the Version field value +func (o *CreateInstancePayload) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *CreateInstancePayload) SetVersion(v string) { + o.Version = v +} + +func (o CreateInstancePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateInstancePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["acl"] = o.Acl + toSerialize["backupSchedule"] = o.BackupSchedule + toSerialize["flavorId"] = o.FlavorId + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + toSerialize["options"] = o.Options + toSerialize["replicas"] = o.Replicas + toSerialize["storage"] = o.Storage + toSerialize["version"] = o.Version + return toSerialize, nil +} + +func (o *CreateInstancePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "acl", + "backupSchedule", + "flavorId", + "name", + "options", + "replicas", + "storage", + "version", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateInstancePayload := _CreateInstancePayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateInstancePayload) + + if err != nil { + return err + } + + *o = CreateInstancePayload(varCreateInstancePayload) + + return err +} + +type NullableCreateInstancePayload struct { + value *CreateInstancePayload + isSet bool +} + +func (v NullableCreateInstancePayload) Get() *CreateInstancePayload { + return v.value +} + +func (v *NullableCreateInstancePayload) Set(val *CreateInstancePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateInstancePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateInstancePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateInstancePayload(val *CreateInstancePayload) *NullableCreateInstancePayload { + return &NullableCreateInstancePayload{value: val, isSet: true} +} + +func (v NullableCreateInstancePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateInstancePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_create_instance_response.go b/services/postgresflex/v1api/model_create_instance_response.go new file mode 100644 index 000000000..67b8e15dc --- /dev/null +++ b/services/postgresflex/v1api/model_create_instance_response.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the CreateInstanceResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateInstanceResponse{} + +// CreateInstanceResponse struct for CreateInstanceResponse +type CreateInstanceResponse struct { + Id *string `json:"id,omitempty"` +} + +// NewCreateInstanceResponse instantiates a new CreateInstanceResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateInstanceResponse() *CreateInstanceResponse { + this := CreateInstanceResponse{} + return &this +} + +// NewCreateInstanceResponseWithDefaults instantiates a new CreateInstanceResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateInstanceResponseWithDefaults() *CreateInstanceResponse { + this := CreateInstanceResponse{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CreateInstanceResponse) 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 *CreateInstanceResponse) 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 *CreateInstanceResponse) 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 *CreateInstanceResponse) SetId(v string) { + o.Id = &v +} + +func (o CreateInstanceResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateInstanceResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + return toSerialize, nil +} + +type NullableCreateInstanceResponse struct { + value *CreateInstanceResponse + isSet bool +} + +func (v NullableCreateInstanceResponse) Get() *CreateInstanceResponse { + return v.value +} + +func (v *NullableCreateInstanceResponse) Set(val *CreateInstanceResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCreateInstanceResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateInstanceResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateInstanceResponse(val *CreateInstanceResponse) *NullableCreateInstanceResponse { + return &NullableCreateInstanceResponse{value: val, isSet: true} +} + +func (v NullableCreateInstanceResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateInstanceResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_create_user_payload.go b/services/postgresflex/v1api/model_create_user_payload.go new file mode 100644 index 000000000..8ad685be1 --- /dev/null +++ b/services/postgresflex/v1api/model_create_user_payload.go @@ -0,0 +1,161 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the CreateUserPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateUserPayload{} + +// CreateUserPayload struct for CreateUserPayload +type CreateUserPayload struct { + Roles []string `json:"roles,omitempty"` + Username *string `json:"username,omitempty"` +} + +// NewCreateUserPayload instantiates a new CreateUserPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateUserPayload() *CreateUserPayload { + this := CreateUserPayload{} + return &this +} + +// NewCreateUserPayloadWithDefaults instantiates a new CreateUserPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateUserPayloadWithDefaults() *CreateUserPayload { + this := CreateUserPayload{} + return &this +} + +// GetRoles returns the Roles field value if set, zero value otherwise. +func (o *CreateUserPayload) GetRoles() []string { + if o == nil || IsNil(o.Roles) { + var ret []string + return ret + } + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateUserPayload) GetRolesOk() ([]string, bool) { + if o == nil || IsNil(o.Roles) { + return nil, false + } + return o.Roles, true +} + +// HasRoles returns a boolean if a field has been set. +func (o *CreateUserPayload) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { + return true + } + + return false +} + +// SetRoles gets a reference to the given []string and assigns it to the Roles field. +func (o *CreateUserPayload) SetRoles(v []string) { + o.Roles = v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *CreateUserPayload) GetUsername() string { + if o == nil || IsNil(o.Username) { + var ret string + return ret + } + return *o.Username +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateUserPayload) GetUsernameOk() (*string, bool) { + if o == nil || IsNil(o.Username) { + return nil, false + } + return o.Username, true +} + +// HasUsername returns a boolean if a field has been set. +func (o *CreateUserPayload) HasUsername() bool { + if o != nil && !IsNil(o.Username) { + return true + } + + return false +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *CreateUserPayload) SetUsername(v string) { + o.Username = &v +} + +func (o CreateUserPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateUserPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Roles) { + toSerialize["roles"] = o.Roles + } + if !IsNil(o.Username) { + toSerialize["username"] = o.Username + } + return toSerialize, nil +} + +type NullableCreateUserPayload struct { + value *CreateUserPayload + isSet bool +} + +func (v NullableCreateUserPayload) Get() *CreateUserPayload { + return v.value +} + +func (v *NullableCreateUserPayload) Set(val *CreateUserPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateUserPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateUserPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateUserPayload(val *CreateUserPayload) *NullableCreateUserPayload { + return &NullableCreateUserPayload{value: val, isSet: true} +} + +func (v NullableCreateUserPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateUserPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_create_user_response.go b/services/postgresflex/v1api/model_create_user_response.go new file mode 100644 index 000000000..771b27fb2 --- /dev/null +++ b/services/postgresflex/v1api/model_create_user_response.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the CreateUserResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateUserResponse{} + +// CreateUserResponse struct for CreateUserResponse +type CreateUserResponse struct { + Item *User `json:"item,omitempty"` +} + +// NewCreateUserResponse instantiates a new CreateUserResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateUserResponse() *CreateUserResponse { + this := CreateUserResponse{} + return &this +} + +// NewCreateUserResponseWithDefaults instantiates a new CreateUserResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateUserResponseWithDefaults() *CreateUserResponse { + this := CreateUserResponse{} + return &this +} + +// GetItem returns the Item field value if set, zero value otherwise. +func (o *CreateUserResponse) GetItem() User { + if o == nil || IsNil(o.Item) { + var ret User + return ret + } + return *o.Item +} + +// GetItemOk returns a tuple with the Item field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateUserResponse) GetItemOk() (*User, bool) { + if o == nil || IsNil(o.Item) { + return nil, false + } + return o.Item, true +} + +// HasItem returns a boolean if a field has been set. +func (o *CreateUserResponse) HasItem() bool { + if o != nil && !IsNil(o.Item) { + return true + } + + return false +} + +// SetItem gets a reference to the given User and assigns it to the Item field. +func (o *CreateUserResponse) SetItem(v User) { + o.Item = &v +} + +func (o CreateUserResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateUserResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Item) { + toSerialize["item"] = o.Item + } + return toSerialize, nil +} + +type NullableCreateUserResponse struct { + value *CreateUserResponse + isSet bool +} + +func (v NullableCreateUserResponse) Get() *CreateUserResponse { + return v.value +} + +func (v *NullableCreateUserResponse) Set(val *CreateUserResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCreateUserResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateUserResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateUserResponse(val *CreateUserResponse) *NullableCreateUserResponse { + return &NullableCreateUserResponse{value: val, isSet: true} +} + +func (v NullableCreateUserResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateUserResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_error.go b/services/postgresflex/v1api/model_error.go new file mode 100644 index 000000000..9dff599d2 --- /dev/null +++ b/services/postgresflex/v1api/model_error.go @@ -0,0 +1,233 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the Error type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Error{} + +// Error struct for Error +type Error struct { + Code *int32 `json:"code,omitempty"` + Fields *map[string][]string `json:"fields,omitempty"` + Message *string `json:"message,omitempty"` + Type *string `json:"type,omitempty"` +} + +// 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() *Error { + this := Error{} + 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 if set, zero value otherwise. +func (o *Error) GetCode() int32 { + if o == nil || IsNil(o.Code) { + var ret int32 + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Error) GetCodeOk() (*int32, bool) { + if o == nil || IsNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *Error) HasCode() bool { + if o != nil && !IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given int32 and assigns it to the Code field. +func (o *Error) SetCode(v int32) { + o.Code = &v +} + +// GetFields returns the Fields field value if set, zero value otherwise. +func (o *Error) GetFields() map[string][]string { + if o == nil || IsNil(o.Fields) { + var ret map[string][]string + return ret + } + return *o.Fields +} + +// GetFieldsOk returns a tuple with the Fields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Error) GetFieldsOk() (*map[string][]string, bool) { + if o == nil || IsNil(o.Fields) { + return nil, false + } + return o.Fields, true +} + +// HasFields returns a boolean if a field has been set. +func (o *Error) HasFields() bool { + if o != nil && !IsNil(o.Fields) { + return true + } + + return false +} + +// SetFields gets a reference to the given map[string][]string and assigns it to the Fields field. +func (o *Error) SetFields(v map[string][]string) { + o.Fields = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *Error) GetMessage() string { + if o == nil || IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Error) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *Error) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *Error) SetMessage(v string) { + o.Message = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *Error) 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 *Error) 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 *Error) 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 *Error) SetType(v string) { + o.Type = &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{}{} + if !IsNil(o.Code) { + toSerialize["code"] = o.Code + } + if !IsNil(o.Fields) { + toSerialize["fields"] = o.Fields + } + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +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/postgresflex/v1api/model_extensions_configuration.go b/services/postgresflex/v1api/model_extensions_configuration.go new file mode 100644 index 000000000..39e88c5d8 --- /dev/null +++ b/services/postgresflex/v1api/model_extensions_configuration.go @@ -0,0 +1,161 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the ExtensionsConfiguration type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ExtensionsConfiguration{} + +// ExtensionsConfiguration struct for ExtensionsConfiguration +type ExtensionsConfiguration struct { + Name *string `json:"name,omitempty"` + Setting *string `json:"setting,omitempty"` +} + +// NewExtensionsConfiguration instantiates a new ExtensionsConfiguration object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewExtensionsConfiguration() *ExtensionsConfiguration { + this := ExtensionsConfiguration{} + return &this +} + +// NewExtensionsConfigurationWithDefaults instantiates a new ExtensionsConfiguration object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewExtensionsConfigurationWithDefaults() *ExtensionsConfiguration { + this := ExtensionsConfiguration{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *ExtensionsConfiguration) 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 *ExtensionsConfiguration) 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 *ExtensionsConfiguration) 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 *ExtensionsConfiguration) SetName(v string) { + o.Name = &v +} + +// GetSetting returns the Setting field value if set, zero value otherwise. +func (o *ExtensionsConfiguration) GetSetting() string { + if o == nil || IsNil(o.Setting) { + var ret string + return ret + } + return *o.Setting +} + +// GetSettingOk returns a tuple with the Setting field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ExtensionsConfiguration) GetSettingOk() (*string, bool) { + if o == nil || IsNil(o.Setting) { + return nil, false + } + return o.Setting, true +} + +// HasSetting returns a boolean if a field has been set. +func (o *ExtensionsConfiguration) HasSetting() bool { + if o != nil && !IsNil(o.Setting) { + return true + } + + return false +} + +// SetSetting gets a reference to the given string and assigns it to the Setting field. +func (o *ExtensionsConfiguration) SetSetting(v string) { + o.Setting = &v +} + +func (o ExtensionsConfiguration) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ExtensionsConfiguration) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Setting) { + toSerialize["setting"] = o.Setting + } + return toSerialize, nil +} + +type NullableExtensionsConfiguration struct { + value *ExtensionsConfiguration + isSet bool +} + +func (v NullableExtensionsConfiguration) Get() *ExtensionsConfiguration { + return v.value +} + +func (v *NullableExtensionsConfiguration) Set(val *ExtensionsConfiguration) { + v.value = val + v.isSet = true +} + +func (v NullableExtensionsConfiguration) IsSet() bool { + return v.isSet +} + +func (v *NullableExtensionsConfiguration) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableExtensionsConfiguration(val *ExtensionsConfiguration) *NullableExtensionsConfiguration { + return &NullableExtensionsConfiguration{value: val, isSet: true} +} + +func (v NullableExtensionsConfiguration) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableExtensionsConfiguration) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_extensions_extension_list_response.go b/services/postgresflex/v1api/model_extensions_extension_list_response.go new file mode 100644 index 000000000..7018ef7a6 --- /dev/null +++ b/services/postgresflex/v1api/model_extensions_extension_list_response.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the ExtensionsExtensionListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ExtensionsExtensionListResponse{} + +// ExtensionsExtensionListResponse struct for ExtensionsExtensionListResponse +type ExtensionsExtensionListResponse struct { + List []ApiExtensionList `json:"list,omitempty"` +} + +// NewExtensionsExtensionListResponse instantiates a new ExtensionsExtensionListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewExtensionsExtensionListResponse() *ExtensionsExtensionListResponse { + this := ExtensionsExtensionListResponse{} + return &this +} + +// NewExtensionsExtensionListResponseWithDefaults instantiates a new ExtensionsExtensionListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewExtensionsExtensionListResponseWithDefaults() *ExtensionsExtensionListResponse { + this := ExtensionsExtensionListResponse{} + return &this +} + +// GetList returns the List field value if set, zero value otherwise. +func (o *ExtensionsExtensionListResponse) GetList() []ApiExtensionList { + if o == nil || IsNil(o.List) { + var ret []ApiExtensionList + return ret + } + return o.List +} + +// GetListOk returns a tuple with the List field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ExtensionsExtensionListResponse) GetListOk() ([]ApiExtensionList, bool) { + if o == nil || IsNil(o.List) { + return nil, false + } + return o.List, true +} + +// HasList returns a boolean if a field has been set. +func (o *ExtensionsExtensionListResponse) HasList() bool { + if o != nil && !IsNil(o.List) { + return true + } + + return false +} + +// SetList gets a reference to the given []ApiExtensionList and assigns it to the List field. +func (o *ExtensionsExtensionListResponse) SetList(v []ApiExtensionList) { + o.List = v +} + +func (o ExtensionsExtensionListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ExtensionsExtensionListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.List) { + toSerialize["list"] = o.List + } + return toSerialize, nil +} + +type NullableExtensionsExtensionListResponse struct { + value *ExtensionsExtensionListResponse + isSet bool +} + +func (v NullableExtensionsExtensionListResponse) Get() *ExtensionsExtensionListResponse { + return v.value +} + +func (v *NullableExtensionsExtensionListResponse) Set(val *ExtensionsExtensionListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableExtensionsExtensionListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableExtensionsExtensionListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableExtensionsExtensionListResponse(val *ExtensionsExtensionListResponse) *NullableExtensionsExtensionListResponse { + return &NullableExtensionsExtensionListResponse{value: val, isSet: true} +} + +func (v NullableExtensionsExtensionListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableExtensionsExtensionListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_extensions_new_config.go b/services/postgresflex/v1api/model_extensions_new_config.go new file mode 100644 index 000000000..c2c56bbc6 --- /dev/null +++ b/services/postgresflex/v1api/model_extensions_new_config.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the ExtensionsNewConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ExtensionsNewConfig{} + +// ExtensionsNewConfig struct for ExtensionsNewConfig +type ExtensionsNewConfig struct { + Configuration []ExtensionsConfiguration `json:"configuration,omitempty"` +} + +// NewExtensionsNewConfig instantiates a new ExtensionsNewConfig object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewExtensionsNewConfig() *ExtensionsNewConfig { + this := ExtensionsNewConfig{} + return &this +} + +// NewExtensionsNewConfigWithDefaults instantiates a new ExtensionsNewConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewExtensionsNewConfigWithDefaults() *ExtensionsNewConfig { + this := ExtensionsNewConfig{} + return &this +} + +// GetConfiguration returns the Configuration field value if set, zero value otherwise. +func (o *ExtensionsNewConfig) GetConfiguration() []ExtensionsConfiguration { + if o == nil || IsNil(o.Configuration) { + var ret []ExtensionsConfiguration + return ret + } + return o.Configuration +} + +// GetConfigurationOk returns a tuple with the Configuration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ExtensionsNewConfig) GetConfigurationOk() ([]ExtensionsConfiguration, bool) { + if o == nil || IsNil(o.Configuration) { + return nil, false + } + return o.Configuration, true +} + +// HasConfiguration returns a boolean if a field has been set. +func (o *ExtensionsNewConfig) HasConfiguration() bool { + if o != nil && !IsNil(o.Configuration) { + return true + } + + return false +} + +// SetConfiguration gets a reference to the given []ExtensionsConfiguration and assigns it to the Configuration field. +func (o *ExtensionsNewConfig) SetConfiguration(v []ExtensionsConfiguration) { + o.Configuration = v +} + +func (o ExtensionsNewConfig) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ExtensionsNewConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Configuration) { + toSerialize["configuration"] = o.Configuration + } + return toSerialize, nil +} + +type NullableExtensionsNewConfig struct { + value *ExtensionsNewConfig + isSet bool +} + +func (v NullableExtensionsNewConfig) Get() *ExtensionsNewConfig { + return v.value +} + +func (v *NullableExtensionsNewConfig) Set(val *ExtensionsNewConfig) { + v.value = val + v.isSet = true +} + +func (v NullableExtensionsNewConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableExtensionsNewConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableExtensionsNewConfig(val *ExtensionsNewConfig) *NullableExtensionsNewConfig { + return &NullableExtensionsNewConfig{value: val, isSet: true} +} + +func (v NullableExtensionsNewConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableExtensionsNewConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_flavor.go b/services/postgresflex/v1api/model_flavor.go new file mode 100644 index 000000000..b1ccdb827 --- /dev/null +++ b/services/postgresflex/v1api/model_flavor.go @@ -0,0 +1,233 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the Flavor type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Flavor{} + +// Flavor struct for Flavor +type Flavor struct { + Cpu *int32 `json:"cpu,omitempty"` + Description *string `json:"description,omitempty"` + Id *string `json:"id,omitempty"` + Memory *int32 `json:"memory,omitempty"` +} + +// NewFlavor instantiates a new Flavor object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFlavor() *Flavor { + this := Flavor{} + return &this +} + +// NewFlavorWithDefaults instantiates a new Flavor object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFlavorWithDefaults() *Flavor { + this := Flavor{} + return &this +} + +// GetCpu returns the Cpu field value if set, zero value otherwise. +func (o *Flavor) GetCpu() int32 { + if o == nil || IsNil(o.Cpu) { + var ret int32 + return ret + } + return *o.Cpu +} + +// GetCpuOk returns a tuple with the Cpu field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Flavor) GetCpuOk() (*int32, bool) { + if o == nil || IsNil(o.Cpu) { + return nil, false + } + return o.Cpu, true +} + +// HasCpu returns a boolean if a field has been set. +func (o *Flavor) HasCpu() bool { + if o != nil && !IsNil(o.Cpu) { + return true + } + + return false +} + +// SetCpu gets a reference to the given int32 and assigns it to the Cpu field. +func (o *Flavor) SetCpu(v int32) { + o.Cpu = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Flavor) 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 *Flavor) 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 *Flavor) 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 *Flavor) SetDescription(v string) { + o.Description = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Flavor) 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 *Flavor) 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 *Flavor) 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 *Flavor) SetId(v string) { + o.Id = &v +} + +// GetMemory returns the Memory field value if set, zero value otherwise. +func (o *Flavor) GetMemory() int32 { + if o == nil || IsNil(o.Memory) { + var ret int32 + return ret + } + return *o.Memory +} + +// GetMemoryOk returns a tuple with the Memory field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Flavor) GetMemoryOk() (*int32, bool) { + if o == nil || IsNil(o.Memory) { + return nil, false + } + return o.Memory, true +} + +// HasMemory returns a boolean if a field has been set. +func (o *Flavor) HasMemory() bool { + if o != nil && !IsNil(o.Memory) { + return true + } + + return false +} + +// SetMemory gets a reference to the given int32 and assigns it to the Memory field. +func (o *Flavor) SetMemory(v int32) { + o.Memory = &v +} + +func (o Flavor) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Flavor) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Cpu) { + toSerialize["cpu"] = o.Cpu + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Memory) { + toSerialize["memory"] = o.Memory + } + return toSerialize, nil +} + +type NullableFlavor struct { + value *Flavor + isSet bool +} + +func (v NullableFlavor) Get() *Flavor { + return v.value +} + +func (v *NullableFlavor) Set(val *Flavor) { + v.value = val + v.isSet = true +} + +func (v NullableFlavor) IsSet() bool { + return v.isSet +} + +func (v *NullableFlavor) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFlavor(val *Flavor) *NullableFlavor { + return &NullableFlavor{value: val, isSet: true} +} + +func (v NullableFlavor) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFlavor) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_get_backup_response.go b/services/postgresflex/v1api/model_get_backup_response.go new file mode 100644 index 000000000..1794cfa51 --- /dev/null +++ b/services/postgresflex/v1api/model_get_backup_response.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the GetBackupResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBackupResponse{} + +// GetBackupResponse struct for GetBackupResponse +type GetBackupResponse struct { + Item *Backup `json:"item,omitempty"` +} + +// NewGetBackupResponse instantiates a new GetBackupResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetBackupResponse() *GetBackupResponse { + this := GetBackupResponse{} + return &this +} + +// NewGetBackupResponseWithDefaults instantiates a new GetBackupResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetBackupResponseWithDefaults() *GetBackupResponse { + this := GetBackupResponse{} + return &this +} + +// GetItem returns the Item field value if set, zero value otherwise. +func (o *GetBackupResponse) GetItem() Backup { + if o == nil || IsNil(o.Item) { + var ret Backup + return ret + } + return *o.Item +} + +// GetItemOk returns a tuple with the Item field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBackupResponse) GetItemOk() (*Backup, bool) { + if o == nil || IsNil(o.Item) { + return nil, false + } + return o.Item, true +} + +// HasItem returns a boolean if a field has been set. +func (o *GetBackupResponse) HasItem() bool { + if o != nil && !IsNil(o.Item) { + return true + } + + return false +} + +// SetItem gets a reference to the given Backup and assigns it to the Item field. +func (o *GetBackupResponse) SetItem(v Backup) { + o.Item = &v +} + +func (o GetBackupResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBackupResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Item) { + toSerialize["item"] = o.Item + } + return toSerialize, nil +} + +type NullableGetBackupResponse struct { + value *GetBackupResponse + isSet bool +} + +func (v NullableGetBackupResponse) Get() *GetBackupResponse { + return v.value +} + +func (v *NullableGetBackupResponse) Set(val *GetBackupResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetBackupResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBackupResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBackupResponse(val *GetBackupResponse) *NullableGetBackupResponse { + return &NullableGetBackupResponse{value: val, isSet: true} +} + +func (v NullableGetBackupResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBackupResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_get_user_response.go b/services/postgresflex/v1api/model_get_user_response.go new file mode 100644 index 000000000..509abc007 --- /dev/null +++ b/services/postgresflex/v1api/model_get_user_response.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the GetUserResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetUserResponse{} + +// GetUserResponse struct for GetUserResponse +type GetUserResponse struct { + Item *UserResponse `json:"item,omitempty"` +} + +// NewGetUserResponse instantiates a new GetUserResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetUserResponse() *GetUserResponse { + this := GetUserResponse{} + return &this +} + +// NewGetUserResponseWithDefaults instantiates a new GetUserResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetUserResponseWithDefaults() *GetUserResponse { + this := GetUserResponse{} + return &this +} + +// GetItem returns the Item field value if set, zero value otherwise. +func (o *GetUserResponse) GetItem() UserResponse { + if o == nil || IsNil(o.Item) { + var ret UserResponse + return ret + } + return *o.Item +} + +// GetItemOk returns a tuple with the Item field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetUserResponse) GetItemOk() (*UserResponse, bool) { + if o == nil || IsNil(o.Item) { + return nil, false + } + return o.Item, true +} + +// HasItem returns a boolean if a field has been set. +func (o *GetUserResponse) HasItem() bool { + if o != nil && !IsNil(o.Item) { + return true + } + + return false +} + +// SetItem gets a reference to the given UserResponse and assigns it to the Item field. +func (o *GetUserResponse) SetItem(v UserResponse) { + o.Item = &v +} + +func (o GetUserResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetUserResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Item) { + toSerialize["item"] = o.Item + } + return toSerialize, nil +} + +type NullableGetUserResponse struct { + value *GetUserResponse + isSet bool +} + +func (v NullableGetUserResponse) Get() *GetUserResponse { + return v.value +} + +func (v *NullableGetUserResponse) Set(val *GetUserResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetUserResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetUserResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetUserResponse(val *GetUserResponse) *NullableGetUserResponse { + return &NullableGetUserResponse{value: val, isSet: true} +} + +func (v NullableGetUserResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetUserResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_instance.go b/services/postgresflex/v1api/model_instance.go new file mode 100644 index 000000000..9014c3245 --- /dev/null +++ b/services/postgresflex/v1api/model_instance.go @@ -0,0 +1,449 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the Instance type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Instance{} + +// Instance struct for Instance +type Instance struct { + Acl *ACL `json:"acl,omitempty"` + BackupSchedule *string `json:"backupSchedule,omitempty"` + Flavor *Flavor `json:"flavor,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Options *map[string]string `json:"options,omitempty"` + Replicas *int32 `json:"replicas,omitempty"` + Status *string `json:"status,omitempty"` + Storage *Storage `json:"storage,omitempty"` + Version *string `json:"version,omitempty"` +} + +// NewInstance instantiates a new Instance object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstance() *Instance { + this := Instance{} + return &this +} + +// NewInstanceWithDefaults instantiates a new Instance object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceWithDefaults() *Instance { + this := Instance{} + return &this +} + +// GetAcl returns the Acl field value if set, zero value otherwise. +func (o *Instance) GetAcl() ACL { + if o == nil || IsNil(o.Acl) { + var ret ACL + return ret + } + return *o.Acl +} + +// GetAclOk returns a tuple with the Acl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Instance) GetAclOk() (*ACL, bool) { + if o == nil || IsNil(o.Acl) { + return nil, false + } + return o.Acl, true +} + +// HasAcl returns a boolean if a field has been set. +func (o *Instance) HasAcl() bool { + if o != nil && !IsNil(o.Acl) { + return true + } + + return false +} + +// SetAcl gets a reference to the given ACL and assigns it to the Acl field. +func (o *Instance) SetAcl(v ACL) { + o.Acl = &v +} + +// GetBackupSchedule returns the BackupSchedule field value if set, zero value otherwise. +func (o *Instance) GetBackupSchedule() string { + if o == nil || IsNil(o.BackupSchedule) { + var ret string + return ret + } + return *o.BackupSchedule +} + +// GetBackupScheduleOk returns a tuple with the BackupSchedule field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Instance) GetBackupScheduleOk() (*string, bool) { + if o == nil || IsNil(o.BackupSchedule) { + return nil, false + } + return o.BackupSchedule, true +} + +// HasBackupSchedule returns a boolean if a field has been set. +func (o *Instance) HasBackupSchedule() bool { + if o != nil && !IsNil(o.BackupSchedule) { + return true + } + + return false +} + +// SetBackupSchedule gets a reference to the given string and assigns it to the BackupSchedule field. +func (o *Instance) SetBackupSchedule(v string) { + o.BackupSchedule = &v +} + +// GetFlavor returns the Flavor field value if set, zero value otherwise. +func (o *Instance) GetFlavor() Flavor { + if o == nil || IsNil(o.Flavor) { + var ret Flavor + return ret + } + return *o.Flavor +} + +// GetFlavorOk returns a tuple with the Flavor field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Instance) GetFlavorOk() (*Flavor, bool) { + if o == nil || IsNil(o.Flavor) { + return nil, false + } + return o.Flavor, true +} + +// HasFlavor returns a boolean if a field has been set. +func (o *Instance) HasFlavor() bool { + if o != nil && !IsNil(o.Flavor) { + return true + } + + return false +} + +// SetFlavor gets a reference to the given Flavor and assigns it to the Flavor field. +func (o *Instance) SetFlavor(v Flavor) { + o.Flavor = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Instance) 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 *Instance) 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 *Instance) 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 *Instance) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Instance) 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 *Instance) 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 *Instance) 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 *Instance) SetName(v string) { + o.Name = &v +} + +// GetOptions returns the Options field value if set, zero value otherwise. +func (o *Instance) GetOptions() map[string]string { + if o == nil || IsNil(o.Options) { + var ret map[string]string + return ret + } + return *o.Options +} + +// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Instance) GetOptionsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Options) { + return nil, false + } + return o.Options, true +} + +// HasOptions returns a boolean if a field has been set. +func (o *Instance) HasOptions() bool { + if o != nil && !IsNil(o.Options) { + return true + } + + return false +} + +// SetOptions gets a reference to the given map[string]string and assigns it to the Options field. +func (o *Instance) SetOptions(v map[string]string) { + o.Options = &v +} + +// GetReplicas returns the Replicas field value if set, zero value otherwise. +func (o *Instance) GetReplicas() int32 { + if o == nil || IsNil(o.Replicas) { + var ret int32 + return ret + } + return *o.Replicas +} + +// GetReplicasOk returns a tuple with the Replicas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Instance) GetReplicasOk() (*int32, bool) { + if o == nil || IsNil(o.Replicas) { + return nil, false + } + return o.Replicas, true +} + +// HasReplicas returns a boolean if a field has been set. +func (o *Instance) HasReplicas() bool { + if o != nil && !IsNil(o.Replicas) { + return true + } + + return false +} + +// SetReplicas gets a reference to the given int32 and assigns it to the Replicas field. +func (o *Instance) SetReplicas(v int32) { + o.Replicas = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Instance) 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 *Instance) 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 *Instance) 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 *Instance) SetStatus(v string) { + o.Status = &v +} + +// GetStorage returns the Storage field value if set, zero value otherwise. +func (o *Instance) GetStorage() Storage { + if o == nil || IsNil(o.Storage) { + var ret Storage + return ret + } + return *o.Storage +} + +// GetStorageOk returns a tuple with the Storage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Instance) GetStorageOk() (*Storage, bool) { + if o == nil || IsNil(o.Storage) { + return nil, false + } + return o.Storage, true +} + +// HasStorage returns a boolean if a field has been set. +func (o *Instance) HasStorage() bool { + if o != nil && !IsNil(o.Storage) { + return true + } + + return false +} + +// SetStorage gets a reference to the given Storage and assigns it to the Storage field. +func (o *Instance) SetStorage(v Storage) { + o.Storage = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *Instance) GetVersion() string { + if o == nil || IsNil(o.Version) { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Instance) GetVersionOk() (*string, bool) { + if o == nil || IsNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *Instance) HasVersion() bool { + if o != nil && !IsNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *Instance) SetVersion(v string) { + o.Version = &v +} + +func (o Instance) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Instance) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Acl) { + toSerialize["acl"] = o.Acl + } + if !IsNil(o.BackupSchedule) { + toSerialize["backupSchedule"] = o.BackupSchedule + } + if !IsNil(o.Flavor) { + toSerialize["flavor"] = o.Flavor + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Options) { + toSerialize["options"] = o.Options + } + if !IsNil(o.Replicas) { + toSerialize["replicas"] = o.Replicas + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Storage) { + toSerialize["storage"] = o.Storage + } + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + return toSerialize, nil +} + +type NullableInstance struct { + value *Instance + isSet bool +} + +func (v NullableInstance) Get() *Instance { + return v.value +} + +func (v *NullableInstance) Set(val *Instance) { + v.value = val + v.isSet = true +} + +func (v NullableInstance) IsSet() bool { + return v.isSet +} + +func (v *NullableInstance) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstance(val *Instance) *NullableInstance { + return &NullableInstance{value: val, isSet: true} +} + +func (v NullableInstance) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstance) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_instance_create_database_response.go b/services/postgresflex/v1api/model_instance_create_database_response.go new file mode 100644 index 000000000..9fe2e69a3 --- /dev/null +++ b/services/postgresflex/v1api/model_instance_create_database_response.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the InstanceCreateDatabaseResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceCreateDatabaseResponse{} + +// InstanceCreateDatabaseResponse struct for InstanceCreateDatabaseResponse +type InstanceCreateDatabaseResponse struct { + Id *string `json:"id,omitempty"` +} + +// NewInstanceCreateDatabaseResponse instantiates a new InstanceCreateDatabaseResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceCreateDatabaseResponse() *InstanceCreateDatabaseResponse { + this := InstanceCreateDatabaseResponse{} + return &this +} + +// NewInstanceCreateDatabaseResponseWithDefaults instantiates a new InstanceCreateDatabaseResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceCreateDatabaseResponseWithDefaults() *InstanceCreateDatabaseResponse { + this := InstanceCreateDatabaseResponse{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *InstanceCreateDatabaseResponse) 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 *InstanceCreateDatabaseResponse) 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 *InstanceCreateDatabaseResponse) 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 *InstanceCreateDatabaseResponse) SetId(v string) { + o.Id = &v +} + +func (o InstanceCreateDatabaseResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceCreateDatabaseResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + return toSerialize, nil +} + +type NullableInstanceCreateDatabaseResponse struct { + value *InstanceCreateDatabaseResponse + isSet bool +} + +func (v NullableInstanceCreateDatabaseResponse) Get() *InstanceCreateDatabaseResponse { + return v.value +} + +func (v *NullableInstanceCreateDatabaseResponse) Set(val *InstanceCreateDatabaseResponse) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceCreateDatabaseResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceCreateDatabaseResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceCreateDatabaseResponse(val *InstanceCreateDatabaseResponse) *NullableInstanceCreateDatabaseResponse { + return &NullableInstanceCreateDatabaseResponse{value: val, isSet: true} +} + +func (v NullableInstanceCreateDatabaseResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceCreateDatabaseResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_instance_data_point.go b/services/postgresflex/v1api/model_instance_data_point.go new file mode 100644 index 000000000..13a3c8b98 --- /dev/null +++ b/services/postgresflex/v1api/model_instance_data_point.go @@ -0,0 +1,161 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the InstanceDataPoint type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceDataPoint{} + +// InstanceDataPoint struct for InstanceDataPoint +type InstanceDataPoint struct { + Timestamp *string `json:"timestamp,omitempty"` + Value *float32 `json:"value,omitempty"` +} + +// NewInstanceDataPoint instantiates a new InstanceDataPoint object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceDataPoint() *InstanceDataPoint { + this := InstanceDataPoint{} + return &this +} + +// NewInstanceDataPointWithDefaults instantiates a new InstanceDataPoint object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceDataPointWithDefaults() *InstanceDataPoint { + this := InstanceDataPoint{} + return &this +} + +// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +func (o *InstanceDataPoint) GetTimestamp() string { + if o == nil || IsNil(o.Timestamp) { + var ret string + return ret + } + return *o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceDataPoint) GetTimestampOk() (*string, bool) { + if o == nil || IsNil(o.Timestamp) { + return nil, false + } + return o.Timestamp, true +} + +// HasTimestamp returns a boolean if a field has been set. +func (o *InstanceDataPoint) HasTimestamp() bool { + if o != nil && !IsNil(o.Timestamp) { + return true + } + + return false +} + +// SetTimestamp gets a reference to the given string and assigns it to the Timestamp field. +func (o *InstanceDataPoint) SetTimestamp(v string) { + o.Timestamp = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *InstanceDataPoint) GetValue() float32 { + if o == nil || IsNil(o.Value) { + var ret float32 + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceDataPoint) GetValueOk() (*float32, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *InstanceDataPoint) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given float32 and assigns it to the Value field. +func (o *InstanceDataPoint) SetValue(v float32) { + o.Value = &v +} + +func (o InstanceDataPoint) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceDataPoint) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Timestamp) { + toSerialize["timestamp"] = o.Timestamp + } + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + return toSerialize, nil +} + +type NullableInstanceDataPoint struct { + value *InstanceDataPoint + isSet bool +} + +func (v NullableInstanceDataPoint) Get() *InstanceDataPoint { + return v.value +} + +func (v *NullableInstanceDataPoint) Set(val *InstanceDataPoint) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceDataPoint) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceDataPoint) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceDataPoint(val *InstanceDataPoint) *NullableInstanceDataPoint { + return &NullableInstanceDataPoint{value: val, isSet: true} +} + +func (v NullableInstanceDataPoint) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceDataPoint) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_instance_database.go b/services/postgresflex/v1api/model_instance_database.go new file mode 100644 index 000000000..4988533f1 --- /dev/null +++ b/services/postgresflex/v1api/model_instance_database.go @@ -0,0 +1,198 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the InstanceDatabase type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceDatabase{} + +// InstanceDatabase struct for InstanceDatabase +type InstanceDatabase struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + // Database specific options + Options map[string]interface{} `json:"options,omitempty"` +} + +// NewInstanceDatabase instantiates a new InstanceDatabase object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceDatabase() *InstanceDatabase { + this := InstanceDatabase{} + return &this +} + +// NewInstanceDatabaseWithDefaults instantiates a new InstanceDatabase object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceDatabaseWithDefaults() *InstanceDatabase { + this := InstanceDatabase{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *InstanceDatabase) 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 *InstanceDatabase) 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 *InstanceDatabase) 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 *InstanceDatabase) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *InstanceDatabase) 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 *InstanceDatabase) 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 *InstanceDatabase) 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 *InstanceDatabase) SetName(v string) { + o.Name = &v +} + +// GetOptions returns the Options field value if set, zero value otherwise. +func (o *InstanceDatabase) GetOptions() map[string]interface{} { + if o == nil || IsNil(o.Options) { + var ret map[string]interface{} + return ret + } + return o.Options +} + +// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceDatabase) GetOptionsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Options) { + return map[string]interface{}{}, false + } + return o.Options, true +} + +// HasOptions returns a boolean if a field has been set. +func (o *InstanceDatabase) HasOptions() bool { + if o != nil && !IsNil(o.Options) { + return true + } + + return false +} + +// SetOptions gets a reference to the given map[string]interface{} and assigns it to the Options field. +func (o *InstanceDatabase) SetOptions(v map[string]interface{}) { + o.Options = v +} + +func (o InstanceDatabase) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceDatabase) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Options) { + toSerialize["options"] = o.Options + } + return toSerialize, nil +} + +type NullableInstanceDatabase struct { + value *InstanceDatabase + isSet bool +} + +func (v NullableInstanceDatabase) Get() *InstanceDatabase { + return v.value +} + +func (v *NullableInstanceDatabase) Set(val *InstanceDatabase) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceDatabase) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceDatabase) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceDatabase(val *InstanceDatabase) *NullableInstanceDatabase { + return &NullableInstanceDatabase{value: val, isSet: true} +} + +func (v NullableInstanceDatabase) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceDatabase) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_instance_host.go b/services/postgresflex/v1api/model_instance_host.go new file mode 100644 index 000000000..0f69246f6 --- /dev/null +++ b/services/postgresflex/v1api/model_instance_host.go @@ -0,0 +1,161 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the InstanceHost type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceHost{} + +// InstanceHost struct for InstanceHost +type InstanceHost struct { + HostMetrics []InstanceHostMetric `json:"hostMetrics,omitempty"` + Id *string `json:"id,omitempty"` +} + +// NewInstanceHost instantiates a new InstanceHost object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceHost() *InstanceHost { + this := InstanceHost{} + return &this +} + +// NewInstanceHostWithDefaults instantiates a new InstanceHost object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceHostWithDefaults() *InstanceHost { + this := InstanceHost{} + return &this +} + +// GetHostMetrics returns the HostMetrics field value if set, zero value otherwise. +func (o *InstanceHost) GetHostMetrics() []InstanceHostMetric { + if o == nil || IsNil(o.HostMetrics) { + var ret []InstanceHostMetric + return ret + } + return o.HostMetrics +} + +// GetHostMetricsOk returns a tuple with the HostMetrics field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceHost) GetHostMetricsOk() ([]InstanceHostMetric, bool) { + if o == nil || IsNil(o.HostMetrics) { + return nil, false + } + return o.HostMetrics, true +} + +// HasHostMetrics returns a boolean if a field has been set. +func (o *InstanceHost) HasHostMetrics() bool { + if o != nil && !IsNil(o.HostMetrics) { + return true + } + + return false +} + +// SetHostMetrics gets a reference to the given []InstanceHostMetric and assigns it to the HostMetrics field. +func (o *InstanceHost) SetHostMetrics(v []InstanceHostMetric) { + o.HostMetrics = v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *InstanceHost) 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 *InstanceHost) 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 *InstanceHost) 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 *InstanceHost) SetId(v string) { + o.Id = &v +} + +func (o InstanceHost) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceHost) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.HostMetrics) { + toSerialize["hostMetrics"] = o.HostMetrics + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + return toSerialize, nil +} + +type NullableInstanceHost struct { + value *InstanceHost + isSet bool +} + +func (v NullableInstanceHost) Get() *InstanceHost { + return v.value +} + +func (v *NullableInstanceHost) Set(val *InstanceHost) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceHost) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceHost) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceHost(val *InstanceHost) *NullableInstanceHost { + return &NullableInstanceHost{value: val, isSet: true} +} + +func (v NullableInstanceHost) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceHost) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_instance_host_metric.go b/services/postgresflex/v1api/model_instance_host_metric.go new file mode 100644 index 000000000..8bf971908 --- /dev/null +++ b/services/postgresflex/v1api/model_instance_host_metric.go @@ -0,0 +1,197 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the InstanceHostMetric type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceHostMetric{} + +// InstanceHostMetric struct for InstanceHostMetric +type InstanceHostMetric struct { + Datapoints []InstanceDataPoint `json:"datapoints,omitempty"` + Name *string `json:"name,omitempty"` + Units *string `json:"units,omitempty"` +} + +// NewInstanceHostMetric instantiates a new InstanceHostMetric object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceHostMetric() *InstanceHostMetric { + this := InstanceHostMetric{} + return &this +} + +// NewInstanceHostMetricWithDefaults instantiates a new InstanceHostMetric object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceHostMetricWithDefaults() *InstanceHostMetric { + this := InstanceHostMetric{} + return &this +} + +// GetDatapoints returns the Datapoints field value if set, zero value otherwise. +func (o *InstanceHostMetric) GetDatapoints() []InstanceDataPoint { + if o == nil || IsNil(o.Datapoints) { + var ret []InstanceDataPoint + return ret + } + return o.Datapoints +} + +// GetDatapointsOk returns a tuple with the Datapoints field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceHostMetric) GetDatapointsOk() ([]InstanceDataPoint, bool) { + if o == nil || IsNil(o.Datapoints) { + return nil, false + } + return o.Datapoints, true +} + +// HasDatapoints returns a boolean if a field has been set. +func (o *InstanceHostMetric) HasDatapoints() bool { + if o != nil && !IsNil(o.Datapoints) { + return true + } + + return false +} + +// SetDatapoints gets a reference to the given []InstanceDataPoint and assigns it to the Datapoints field. +func (o *InstanceHostMetric) SetDatapoints(v []InstanceDataPoint) { + o.Datapoints = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *InstanceHostMetric) 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 *InstanceHostMetric) 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 *InstanceHostMetric) 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 *InstanceHostMetric) SetName(v string) { + o.Name = &v +} + +// GetUnits returns the Units field value if set, zero value otherwise. +func (o *InstanceHostMetric) GetUnits() string { + if o == nil || IsNil(o.Units) { + var ret string + return ret + } + return *o.Units +} + +// GetUnitsOk returns a tuple with the Units field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceHostMetric) GetUnitsOk() (*string, bool) { + if o == nil || IsNil(o.Units) { + return nil, false + } + return o.Units, true +} + +// HasUnits returns a boolean if a field has been set. +func (o *InstanceHostMetric) HasUnits() bool { + if o != nil && !IsNil(o.Units) { + return true + } + + return false +} + +// SetUnits gets a reference to the given string and assigns it to the Units field. +func (o *InstanceHostMetric) SetUnits(v string) { + o.Units = &v +} + +func (o InstanceHostMetric) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceHostMetric) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Datapoints) { + toSerialize["datapoints"] = o.Datapoints + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Units) { + toSerialize["units"] = o.Units + } + return toSerialize, nil +} + +type NullableInstanceHostMetric struct { + value *InstanceHostMetric + isSet bool +} + +func (v NullableInstanceHostMetric) Get() *InstanceHostMetric { + return v.value +} + +func (v *NullableInstanceHostMetric) Set(val *InstanceHostMetric) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceHostMetric) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceHostMetric) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceHostMetric(val *InstanceHostMetric) *NullableInstanceHostMetric { + return &NullableInstanceHostMetric{value: val, isSet: true} +} + +func (v NullableInstanceHostMetric) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceHostMetric) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_instance_list_databases_response.go b/services/postgresflex/v1api/model_instance_list_databases_response.go new file mode 100644 index 000000000..60639be43 --- /dev/null +++ b/services/postgresflex/v1api/model_instance_list_databases_response.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the InstanceListDatabasesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceListDatabasesResponse{} + +// InstanceListDatabasesResponse struct for InstanceListDatabasesResponse +type InstanceListDatabasesResponse struct { + Databases []InstanceDatabase `json:"databases,omitempty"` +} + +// NewInstanceListDatabasesResponse instantiates a new InstanceListDatabasesResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceListDatabasesResponse() *InstanceListDatabasesResponse { + this := InstanceListDatabasesResponse{} + return &this +} + +// NewInstanceListDatabasesResponseWithDefaults instantiates a new InstanceListDatabasesResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceListDatabasesResponseWithDefaults() *InstanceListDatabasesResponse { + this := InstanceListDatabasesResponse{} + return &this +} + +// GetDatabases returns the Databases field value if set, zero value otherwise. +func (o *InstanceListDatabasesResponse) GetDatabases() []InstanceDatabase { + if o == nil || IsNil(o.Databases) { + var ret []InstanceDatabase + return ret + } + return o.Databases +} + +// GetDatabasesOk returns a tuple with the Databases field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceListDatabasesResponse) GetDatabasesOk() ([]InstanceDatabase, bool) { + if o == nil || IsNil(o.Databases) { + return nil, false + } + return o.Databases, true +} + +// HasDatabases returns a boolean if a field has been set. +func (o *InstanceListDatabasesResponse) HasDatabases() bool { + if o != nil && !IsNil(o.Databases) { + return true + } + + return false +} + +// SetDatabases gets a reference to the given []InstanceDatabase and assigns it to the Databases field. +func (o *InstanceListDatabasesResponse) SetDatabases(v []InstanceDatabase) { + o.Databases = v +} + +func (o InstanceListDatabasesResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceListDatabasesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Databases) { + toSerialize["databases"] = o.Databases + } + return toSerialize, nil +} + +type NullableInstanceListDatabasesResponse struct { + value *InstanceListDatabasesResponse + isSet bool +} + +func (v NullableInstanceListDatabasesResponse) Get() *InstanceListDatabasesResponse { + return v.value +} + +func (v *NullableInstanceListDatabasesResponse) Set(val *InstanceListDatabasesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceListDatabasesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceListDatabasesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceListDatabasesResponse(val *InstanceListDatabasesResponse) *NullableInstanceListDatabasesResponse { + return &NullableInstanceListDatabasesResponse{value: val, isSet: true} +} + +func (v NullableInstanceListDatabasesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceListDatabasesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_instance_list_instance.go b/services/postgresflex/v1api/model_instance_list_instance.go new file mode 100644 index 000000000..2eb1ab1ce --- /dev/null +++ b/services/postgresflex/v1api/model_instance_list_instance.go @@ -0,0 +1,197 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the InstanceListInstance type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceListInstance{} + +// InstanceListInstance struct for InstanceListInstance +type InstanceListInstance struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Status *string `json:"status,omitempty"` +} + +// NewInstanceListInstance instantiates a new InstanceListInstance object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceListInstance() *InstanceListInstance { + this := InstanceListInstance{} + return &this +} + +// NewInstanceListInstanceWithDefaults instantiates a new InstanceListInstance object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceListInstanceWithDefaults() *InstanceListInstance { + this := InstanceListInstance{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *InstanceListInstance) 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 *InstanceListInstance) 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 *InstanceListInstance) 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 *InstanceListInstance) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *InstanceListInstance) 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 *InstanceListInstance) 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 *InstanceListInstance) 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 *InstanceListInstance) SetName(v string) { + o.Name = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *InstanceListInstance) 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 *InstanceListInstance) 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 *InstanceListInstance) 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 *InstanceListInstance) SetStatus(v string) { + o.Status = &v +} + +func (o InstanceListInstance) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceListInstance) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + return toSerialize, nil +} + +type NullableInstanceListInstance struct { + value *InstanceListInstance + isSet bool +} + +func (v NullableInstanceListInstance) Get() *InstanceListInstance { + return v.value +} + +func (v *NullableInstanceListInstance) Set(val *InstanceListInstance) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceListInstance) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceListInstance) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceListInstance(val *InstanceListInstance) *NullableInstanceListInstance { + return &NullableInstanceListInstance{value: val, isSet: true} +} + +func (v NullableInstanceListInstance) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceListInstance) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_instance_metrics_response.go b/services/postgresflex/v1api/model_instance_metrics_response.go new file mode 100644 index 000000000..14bedf7df --- /dev/null +++ b/services/postgresflex/v1api/model_instance_metrics_response.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the InstanceMetricsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceMetricsResponse{} + +// InstanceMetricsResponse struct for InstanceMetricsResponse +type InstanceMetricsResponse struct { + Hosts []InstanceHost `json:"hosts,omitempty"` +} + +// NewInstanceMetricsResponse instantiates a new InstanceMetricsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceMetricsResponse() *InstanceMetricsResponse { + this := InstanceMetricsResponse{} + return &this +} + +// NewInstanceMetricsResponseWithDefaults instantiates a new InstanceMetricsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceMetricsResponseWithDefaults() *InstanceMetricsResponse { + this := InstanceMetricsResponse{} + return &this +} + +// GetHosts returns the Hosts field value if set, zero value otherwise. +func (o *InstanceMetricsResponse) GetHosts() []InstanceHost { + if o == nil || IsNil(o.Hosts) { + var ret []InstanceHost + return ret + } + return o.Hosts +} + +// GetHostsOk returns a tuple with the Hosts field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceMetricsResponse) GetHostsOk() ([]InstanceHost, bool) { + if o == nil || IsNil(o.Hosts) { + return nil, false + } + return o.Hosts, true +} + +// HasHosts returns a boolean if a field has been set. +func (o *InstanceMetricsResponse) HasHosts() bool { + if o != nil && !IsNil(o.Hosts) { + return true + } + + return false +} + +// SetHosts gets a reference to the given []InstanceHost and assigns it to the Hosts field. +func (o *InstanceMetricsResponse) SetHosts(v []InstanceHost) { + o.Hosts = v +} + +func (o InstanceMetricsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceMetricsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Hosts) { + toSerialize["hosts"] = o.Hosts + } + return toSerialize, nil +} + +type NullableInstanceMetricsResponse struct { + value *InstanceMetricsResponse + isSet bool +} + +func (v NullableInstanceMetricsResponse) Get() *InstanceMetricsResponse { + return v.value +} + +func (v *NullableInstanceMetricsResponse) Set(val *InstanceMetricsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceMetricsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceMetricsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceMetricsResponse(val *InstanceMetricsResponse) *NullableInstanceMetricsResponse { + return &NullableInstanceMetricsResponse{value: val, isSet: true} +} + +func (v NullableInstanceMetricsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceMetricsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_instance_response.go b/services/postgresflex/v1api/model_instance_response.go new file mode 100644 index 000000000..645ea8734 --- /dev/null +++ b/services/postgresflex/v1api/model_instance_response.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the InstanceResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceResponse{} + +// InstanceResponse struct for InstanceResponse +type InstanceResponse struct { + Item *Instance `json:"item,omitempty"` +} + +// NewInstanceResponse instantiates a new InstanceResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceResponse() *InstanceResponse { + this := InstanceResponse{} + return &this +} + +// NewInstanceResponseWithDefaults instantiates a new InstanceResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceResponseWithDefaults() *InstanceResponse { + this := InstanceResponse{} + return &this +} + +// GetItem returns the Item field value if set, zero value otherwise. +func (o *InstanceResponse) GetItem() Instance { + if o == nil || IsNil(o.Item) { + var ret Instance + return ret + } + return *o.Item +} + +// GetItemOk returns a tuple with the Item field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceResponse) GetItemOk() (*Instance, bool) { + if o == nil || IsNil(o.Item) { + return nil, false + } + return o.Item, true +} + +// HasItem returns a boolean if a field has been set. +func (o *InstanceResponse) HasItem() bool { + if o != nil && !IsNil(o.Item) { + return true + } + + return false +} + +// SetItem gets a reference to the given Instance and assigns it to the Item field. +func (o *InstanceResponse) SetItem(v Instance) { + o.Item = &v +} + +func (o InstanceResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Item) { + toSerialize["item"] = o.Item + } + return toSerialize, nil +} + +type NullableInstanceResponse struct { + value *InstanceResponse + isSet bool +} + +func (v NullableInstanceResponse) Get() *InstanceResponse { + return v.value +} + +func (v *NullableInstanceResponse) Set(val *InstanceResponse) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceResponse(val *InstanceResponse) *NullableInstanceResponse { + return &NullableInstanceResponse{value: val, isSet: true} +} + +func (v NullableInstanceResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_list_backups_response.go b/services/postgresflex/v1api/model_list_backups_response.go new file mode 100644 index 000000000..11bb22a7f --- /dev/null +++ b/services/postgresflex/v1api/model_list_backups_response.go @@ -0,0 +1,161 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the ListBackupsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListBackupsResponse{} + +// ListBackupsResponse struct for ListBackupsResponse +type ListBackupsResponse struct { + Count *int32 `json:"count,omitempty"` + Items []Backup `json:"items,omitempty"` +} + +// NewListBackupsResponse instantiates a new ListBackupsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListBackupsResponse() *ListBackupsResponse { + this := ListBackupsResponse{} + return &this +} + +// NewListBackupsResponseWithDefaults instantiates a new ListBackupsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListBackupsResponseWithDefaults() *ListBackupsResponse { + this := ListBackupsResponse{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *ListBackupsResponse) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListBackupsResponse) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *ListBackupsResponse) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *ListBackupsResponse) SetCount(v int32) { + o.Count = &v +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *ListBackupsResponse) GetItems() []Backup { + if o == nil || IsNil(o.Items) { + var ret []Backup + return ret + } + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListBackupsResponse) GetItemsOk() ([]Backup, bool) { + if o == nil || IsNil(o.Items) { + return nil, false + } + return o.Items, true +} + +// HasItems returns a boolean if a field has been set. +func (o *ListBackupsResponse) HasItems() bool { + if o != nil && !IsNil(o.Items) { + return true + } + + return false +} + +// SetItems gets a reference to the given []Backup and assigns it to the Items field. +func (o *ListBackupsResponse) SetItems(v []Backup) { + o.Items = v +} + +func (o ListBackupsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListBackupsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if !IsNil(o.Items) { + toSerialize["items"] = o.Items + } + return toSerialize, nil +} + +type NullableListBackupsResponse struct { + value *ListBackupsResponse + isSet bool +} + +func (v NullableListBackupsResponse) Get() *ListBackupsResponse { + return v.value +} + +func (v *NullableListBackupsResponse) Set(val *ListBackupsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListBackupsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListBackupsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListBackupsResponse(val *ListBackupsResponse) *NullableListBackupsResponse { + return &NullableListBackupsResponse{value: val, isSet: true} +} + +func (v NullableListBackupsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListBackupsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_list_flavors_response.go b/services/postgresflex/v1api/model_list_flavors_response.go new file mode 100644 index 000000000..eb2cec612 --- /dev/null +++ b/services/postgresflex/v1api/model_list_flavors_response.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the ListFlavorsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListFlavorsResponse{} + +// ListFlavorsResponse struct for ListFlavorsResponse +type ListFlavorsResponse struct { + Flavors []Flavor `json:"flavors,omitempty"` +} + +// NewListFlavorsResponse instantiates a new ListFlavorsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListFlavorsResponse() *ListFlavorsResponse { + this := ListFlavorsResponse{} + return &this +} + +// NewListFlavorsResponseWithDefaults instantiates a new ListFlavorsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListFlavorsResponseWithDefaults() *ListFlavorsResponse { + this := ListFlavorsResponse{} + return &this +} + +// GetFlavors returns the Flavors field value if set, zero value otherwise. +func (o *ListFlavorsResponse) GetFlavors() []Flavor { + if o == nil || IsNil(o.Flavors) { + var ret []Flavor + return ret + } + return o.Flavors +} + +// GetFlavorsOk returns a tuple with the Flavors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListFlavorsResponse) GetFlavorsOk() ([]Flavor, bool) { + if o == nil || IsNil(o.Flavors) { + return nil, false + } + return o.Flavors, true +} + +// HasFlavors returns a boolean if a field has been set. +func (o *ListFlavorsResponse) HasFlavors() bool { + if o != nil && !IsNil(o.Flavors) { + return true + } + + return false +} + +// SetFlavors gets a reference to the given []Flavor and assigns it to the Flavors field. +func (o *ListFlavorsResponse) SetFlavors(v []Flavor) { + o.Flavors = v +} + +func (o ListFlavorsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListFlavorsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Flavors) { + toSerialize["flavors"] = o.Flavors + } + return toSerialize, nil +} + +type NullableListFlavorsResponse struct { + value *ListFlavorsResponse + isSet bool +} + +func (v NullableListFlavorsResponse) Get() *ListFlavorsResponse { + return v.value +} + +func (v *NullableListFlavorsResponse) Set(val *ListFlavorsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListFlavorsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListFlavorsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListFlavorsResponse(val *ListFlavorsResponse) *NullableListFlavorsResponse { + return &NullableListFlavorsResponse{value: val, isSet: true} +} + +func (v NullableListFlavorsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListFlavorsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_list_instances_response.go b/services/postgresflex/v1api/model_list_instances_response.go new file mode 100644 index 000000000..5f62d3214 --- /dev/null +++ b/services/postgresflex/v1api/model_list_instances_response.go @@ -0,0 +1,161 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the ListInstancesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListInstancesResponse{} + +// ListInstancesResponse struct for ListInstancesResponse +type ListInstancesResponse struct { + Count *int32 `json:"count,omitempty"` + Items []InstanceListInstance `json:"items,omitempty"` +} + +// NewListInstancesResponse instantiates a new ListInstancesResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListInstancesResponse() *ListInstancesResponse { + this := ListInstancesResponse{} + return &this +} + +// NewListInstancesResponseWithDefaults instantiates a new ListInstancesResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListInstancesResponseWithDefaults() *ListInstancesResponse { + this := ListInstancesResponse{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *ListInstancesResponse) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListInstancesResponse) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *ListInstancesResponse) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *ListInstancesResponse) SetCount(v int32) { + o.Count = &v +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *ListInstancesResponse) GetItems() []InstanceListInstance { + if o == nil || IsNil(o.Items) { + var ret []InstanceListInstance + return ret + } + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListInstancesResponse) GetItemsOk() ([]InstanceListInstance, bool) { + if o == nil || IsNil(o.Items) { + return nil, false + } + return o.Items, true +} + +// HasItems returns a boolean if a field has been set. +func (o *ListInstancesResponse) HasItems() bool { + if o != nil && !IsNil(o.Items) { + return true + } + + return false +} + +// SetItems gets a reference to the given []InstanceListInstance and assigns it to the Items field. +func (o *ListInstancesResponse) SetItems(v []InstanceListInstance) { + o.Items = v +} + +func (o ListInstancesResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListInstancesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if !IsNil(o.Items) { + toSerialize["items"] = o.Items + } + return toSerialize, nil +} + +type NullableListInstancesResponse struct { + value *ListInstancesResponse + isSet bool +} + +func (v NullableListInstancesResponse) Get() *ListInstancesResponse { + return v.value +} + +func (v *NullableListInstancesResponse) Set(val *ListInstancesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListInstancesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListInstancesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListInstancesResponse(val *ListInstancesResponse) *NullableListInstancesResponse { + return &NullableListInstancesResponse{value: val, isSet: true} +} + +func (v NullableListInstancesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListInstancesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_list_storages_response.go b/services/postgresflex/v1api/model_list_storages_response.go new file mode 100644 index 000000000..22692a92f --- /dev/null +++ b/services/postgresflex/v1api/model_list_storages_response.go @@ -0,0 +1,161 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the ListStoragesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListStoragesResponse{} + +// ListStoragesResponse struct for ListStoragesResponse +type ListStoragesResponse struct { + StorageClasses []string `json:"storageClasses,omitempty"` + StorageRange *StorageRange `json:"storageRange,omitempty"` +} + +// NewListStoragesResponse instantiates a new ListStoragesResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListStoragesResponse() *ListStoragesResponse { + this := ListStoragesResponse{} + return &this +} + +// NewListStoragesResponseWithDefaults instantiates a new ListStoragesResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListStoragesResponseWithDefaults() *ListStoragesResponse { + this := ListStoragesResponse{} + return &this +} + +// GetStorageClasses returns the StorageClasses field value if set, zero value otherwise. +func (o *ListStoragesResponse) GetStorageClasses() []string { + if o == nil || IsNil(o.StorageClasses) { + var ret []string + return ret + } + return o.StorageClasses +} + +// GetStorageClassesOk returns a tuple with the StorageClasses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListStoragesResponse) GetStorageClassesOk() ([]string, bool) { + if o == nil || IsNil(o.StorageClasses) { + return nil, false + } + return o.StorageClasses, true +} + +// HasStorageClasses returns a boolean if a field has been set. +func (o *ListStoragesResponse) HasStorageClasses() bool { + if o != nil && !IsNil(o.StorageClasses) { + return true + } + + return false +} + +// SetStorageClasses gets a reference to the given []string and assigns it to the StorageClasses field. +func (o *ListStoragesResponse) SetStorageClasses(v []string) { + o.StorageClasses = v +} + +// GetStorageRange returns the StorageRange field value if set, zero value otherwise. +func (o *ListStoragesResponse) GetStorageRange() StorageRange { + if o == nil || IsNil(o.StorageRange) { + var ret StorageRange + return ret + } + return *o.StorageRange +} + +// GetStorageRangeOk returns a tuple with the StorageRange field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListStoragesResponse) GetStorageRangeOk() (*StorageRange, bool) { + if o == nil || IsNil(o.StorageRange) { + return nil, false + } + return o.StorageRange, true +} + +// HasStorageRange returns a boolean if a field has been set. +func (o *ListStoragesResponse) HasStorageRange() bool { + if o != nil && !IsNil(o.StorageRange) { + return true + } + + return false +} + +// SetStorageRange gets a reference to the given StorageRange and assigns it to the StorageRange field. +func (o *ListStoragesResponse) SetStorageRange(v StorageRange) { + o.StorageRange = &v +} + +func (o ListStoragesResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListStoragesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.StorageClasses) { + toSerialize["storageClasses"] = o.StorageClasses + } + if !IsNil(o.StorageRange) { + toSerialize["storageRange"] = o.StorageRange + } + return toSerialize, nil +} + +type NullableListStoragesResponse struct { + value *ListStoragesResponse + isSet bool +} + +func (v NullableListStoragesResponse) Get() *ListStoragesResponse { + return v.value +} + +func (v *NullableListStoragesResponse) Set(val *ListStoragesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListStoragesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListStoragesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListStoragesResponse(val *ListStoragesResponse) *NullableListStoragesResponse { + return &NullableListStoragesResponse{value: val, isSet: true} +} + +func (v NullableListStoragesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListStoragesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_list_users_response.go b/services/postgresflex/v1api/model_list_users_response.go new file mode 100644 index 000000000..2d4fb0d0e --- /dev/null +++ b/services/postgresflex/v1api/model_list_users_response.go @@ -0,0 +1,161 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the ListUsersResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListUsersResponse{} + +// ListUsersResponse struct for ListUsersResponse +type ListUsersResponse struct { + Count *int32 `json:"count,omitempty"` + Items []ListUsersResponseItem `json:"items,omitempty"` +} + +// NewListUsersResponse instantiates a new ListUsersResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListUsersResponse() *ListUsersResponse { + this := ListUsersResponse{} + return &this +} + +// NewListUsersResponseWithDefaults instantiates a new ListUsersResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListUsersResponseWithDefaults() *ListUsersResponse { + this := ListUsersResponse{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *ListUsersResponse) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListUsersResponse) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *ListUsersResponse) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *ListUsersResponse) SetCount(v int32) { + o.Count = &v +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *ListUsersResponse) GetItems() []ListUsersResponseItem { + if o == nil || IsNil(o.Items) { + var ret []ListUsersResponseItem + return ret + } + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListUsersResponse) GetItemsOk() ([]ListUsersResponseItem, bool) { + if o == nil || IsNil(o.Items) { + return nil, false + } + return o.Items, true +} + +// HasItems returns a boolean if a field has been set. +func (o *ListUsersResponse) HasItems() bool { + if o != nil && !IsNil(o.Items) { + return true + } + + return false +} + +// SetItems gets a reference to the given []ListUsersResponseItem and assigns it to the Items field. +func (o *ListUsersResponse) SetItems(v []ListUsersResponseItem) { + o.Items = v +} + +func (o ListUsersResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListUsersResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if !IsNil(o.Items) { + toSerialize["items"] = o.Items + } + return toSerialize, nil +} + +type NullableListUsersResponse struct { + value *ListUsersResponse + isSet bool +} + +func (v NullableListUsersResponse) Get() *ListUsersResponse { + return v.value +} + +func (v *NullableListUsersResponse) Set(val *ListUsersResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListUsersResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListUsersResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListUsersResponse(val *ListUsersResponse) *NullableListUsersResponse { + return &NullableListUsersResponse{value: val, isSet: true} +} + +func (v NullableListUsersResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListUsersResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_list_users_response_item.go b/services/postgresflex/v1api/model_list_users_response_item.go new file mode 100644 index 000000000..b752b6880 --- /dev/null +++ b/services/postgresflex/v1api/model_list_users_response_item.go @@ -0,0 +1,161 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the ListUsersResponseItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListUsersResponseItem{} + +// ListUsersResponseItem struct for ListUsersResponseItem +type ListUsersResponseItem struct { + Id *string `json:"id,omitempty"` + Username *string `json:"username,omitempty"` +} + +// NewListUsersResponseItem instantiates a new ListUsersResponseItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListUsersResponseItem() *ListUsersResponseItem { + this := ListUsersResponseItem{} + return &this +} + +// NewListUsersResponseItemWithDefaults instantiates a new ListUsersResponseItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListUsersResponseItemWithDefaults() *ListUsersResponseItem { + this := ListUsersResponseItem{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *ListUsersResponseItem) 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 *ListUsersResponseItem) 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 *ListUsersResponseItem) 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 *ListUsersResponseItem) SetId(v string) { + o.Id = &v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *ListUsersResponseItem) GetUsername() string { + if o == nil || IsNil(o.Username) { + var ret string + return ret + } + return *o.Username +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListUsersResponseItem) GetUsernameOk() (*string, bool) { + if o == nil || IsNil(o.Username) { + return nil, false + } + return o.Username, true +} + +// HasUsername returns a boolean if a field has been set. +func (o *ListUsersResponseItem) HasUsername() bool { + if o != nil && !IsNil(o.Username) { + return true + } + + return false +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *ListUsersResponseItem) SetUsername(v string) { + o.Username = &v +} + +func (o ListUsersResponseItem) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListUsersResponseItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Username) { + toSerialize["username"] = o.Username + } + return toSerialize, nil +} + +type NullableListUsersResponseItem struct { + value *ListUsersResponseItem + isSet bool +} + +func (v NullableListUsersResponseItem) Get() *ListUsersResponseItem { + return v.value +} + +func (v *NullableListUsersResponseItem) Set(val *ListUsersResponseItem) { + v.value = val + v.isSet = true +} + +func (v NullableListUsersResponseItem) IsSet() bool { + return v.isSet +} + +func (v *NullableListUsersResponseItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListUsersResponseItem(val *ListUsersResponseItem) *NullableListUsersResponseItem { + return &NullableListUsersResponseItem{value: val, isSet: true} +} + +func (v NullableListUsersResponseItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListUsersResponseItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_list_versions_response.go b/services/postgresflex/v1api/model_list_versions_response.go new file mode 100644 index 000000000..6f9976ed9 --- /dev/null +++ b/services/postgresflex/v1api/model_list_versions_response.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the ListVersionsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListVersionsResponse{} + +// ListVersionsResponse struct for ListVersionsResponse +type ListVersionsResponse struct { + Versions []string `json:"versions,omitempty"` +} + +// NewListVersionsResponse instantiates a new ListVersionsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListVersionsResponse() *ListVersionsResponse { + this := ListVersionsResponse{} + return &this +} + +// NewListVersionsResponseWithDefaults instantiates a new ListVersionsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListVersionsResponseWithDefaults() *ListVersionsResponse { + this := ListVersionsResponse{} + return &this +} + +// GetVersions returns the Versions field value if set, zero value otherwise. +func (o *ListVersionsResponse) GetVersions() []string { + if o == nil || IsNil(o.Versions) { + var ret []string + return ret + } + return o.Versions +} + +// GetVersionsOk returns a tuple with the Versions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListVersionsResponse) GetVersionsOk() ([]string, bool) { + if o == nil || IsNil(o.Versions) { + return nil, false + } + return o.Versions, true +} + +// HasVersions returns a boolean if a field has been set. +func (o *ListVersionsResponse) HasVersions() bool { + if o != nil && !IsNil(o.Versions) { + return true + } + + return false +} + +// SetVersions gets a reference to the given []string and assigns it to the Versions field. +func (o *ListVersionsResponse) SetVersions(v []string) { + o.Versions = v +} + +func (o ListVersionsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListVersionsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Versions) { + toSerialize["versions"] = o.Versions + } + return toSerialize, nil +} + +type NullableListVersionsResponse struct { + value *ListVersionsResponse + isSet bool +} + +func (v NullableListVersionsResponse) Get() *ListVersionsResponse { + return v.value +} + +func (v *NullableListVersionsResponse) Set(val *ListVersionsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListVersionsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListVersionsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListVersionsResponse(val *ListVersionsResponse) *NullableListVersionsResponse { + return &NullableListVersionsResponse{value: val, isSet: true} +} + +func (v NullableListVersionsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListVersionsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_partial_update_instance_payload.go b/services/postgresflex/v1api/model_partial_update_instance_payload.go new file mode 100644 index 000000000..09d32ea66 --- /dev/null +++ b/services/postgresflex/v1api/model_partial_update_instance_payload.go @@ -0,0 +1,414 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the PartialUpdateInstancePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateInstancePayload{} + +// PartialUpdateInstancePayload struct for PartialUpdateInstancePayload +type PartialUpdateInstancePayload struct { + Acl *ACL `json:"acl,omitempty"` + BackupSchedule *string `json:"backupSchedule,omitempty"` + FlavorId *string `json:"flavorId,omitempty"` + // Labels field is not certain/clear + Labels *map[string]string `json:"labels,omitempty"` + Name *string `json:"name,omitempty"` + Options *map[string]string `json:"options,omitempty"` + Replicas *int32 `json:"replicas,omitempty"` + Storage *StorageUpdate `json:"storage,omitempty"` + Version *string `json:"version,omitempty"` +} + +// NewPartialUpdateInstancePayload instantiates a new PartialUpdateInstancePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPartialUpdateInstancePayload() *PartialUpdateInstancePayload { + this := PartialUpdateInstancePayload{} + return &this +} + +// NewPartialUpdateInstancePayloadWithDefaults instantiates a new PartialUpdateInstancePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPartialUpdateInstancePayloadWithDefaults() *PartialUpdateInstancePayload { + this := PartialUpdateInstancePayload{} + return &this +} + +// GetAcl returns the Acl field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetAcl() ACL { + if o == nil || IsNil(o.Acl) { + var ret ACL + return ret + } + return *o.Acl +} + +// GetAclOk returns a tuple with the Acl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetAclOk() (*ACL, bool) { + if o == nil || IsNil(o.Acl) { + return nil, false + } + return o.Acl, true +} + +// HasAcl returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasAcl() bool { + if o != nil && !IsNil(o.Acl) { + return true + } + + return false +} + +// SetAcl gets a reference to the given ACL and assigns it to the Acl field. +func (o *PartialUpdateInstancePayload) SetAcl(v ACL) { + o.Acl = &v +} + +// GetBackupSchedule returns the BackupSchedule field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetBackupSchedule() string { + if o == nil || IsNil(o.BackupSchedule) { + var ret string + return ret + } + return *o.BackupSchedule +} + +// GetBackupScheduleOk returns a tuple with the BackupSchedule field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetBackupScheduleOk() (*string, bool) { + if o == nil || IsNil(o.BackupSchedule) { + return nil, false + } + return o.BackupSchedule, true +} + +// HasBackupSchedule returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasBackupSchedule() bool { + if o != nil && !IsNil(o.BackupSchedule) { + return true + } + + return false +} + +// SetBackupSchedule gets a reference to the given string and assigns it to the BackupSchedule field. +func (o *PartialUpdateInstancePayload) SetBackupSchedule(v string) { + o.BackupSchedule = &v +} + +// GetFlavorId returns the FlavorId field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetFlavorId() string { + if o == nil || IsNil(o.FlavorId) { + var ret string + return ret + } + return *o.FlavorId +} + +// GetFlavorIdOk returns a tuple with the FlavorId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetFlavorIdOk() (*string, bool) { + if o == nil || IsNil(o.FlavorId) { + return nil, false + } + return o.FlavorId, true +} + +// HasFlavorId returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasFlavorId() bool { + if o != nil && !IsNil(o.FlavorId) { + return true + } + + return false +} + +// SetFlavorId gets a reference to the given string and assigns it to the FlavorId field. +func (o *PartialUpdateInstancePayload) SetFlavorId(v string) { + o.FlavorId = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetLabels() map[string]string { + if o == nil || IsNil(o.Labels) { + var ret map[string]string + 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 *PartialUpdateInstancePayload) GetLabelsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Labels) { + return nil, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *PartialUpdateInstancePayload) SetLabels(v map[string]string) { + o.Labels = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) 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 *PartialUpdateInstancePayload) 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 *PartialUpdateInstancePayload) 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 *PartialUpdateInstancePayload) SetName(v string) { + o.Name = &v +} + +// GetOptions returns the Options field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetOptions() map[string]string { + if o == nil || IsNil(o.Options) { + var ret map[string]string + return ret + } + return *o.Options +} + +// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetOptionsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Options) { + return nil, false + } + return o.Options, true +} + +// HasOptions returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasOptions() bool { + if o != nil && !IsNil(o.Options) { + return true + } + + return false +} + +// SetOptions gets a reference to the given map[string]string and assigns it to the Options field. +func (o *PartialUpdateInstancePayload) SetOptions(v map[string]string) { + o.Options = &v +} + +// GetReplicas returns the Replicas field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetReplicas() int32 { + if o == nil || IsNil(o.Replicas) { + var ret int32 + return ret + } + return *o.Replicas +} + +// GetReplicasOk returns a tuple with the Replicas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetReplicasOk() (*int32, bool) { + if o == nil || IsNil(o.Replicas) { + return nil, false + } + return o.Replicas, true +} + +// HasReplicas returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasReplicas() bool { + if o != nil && !IsNil(o.Replicas) { + return true + } + + return false +} + +// SetReplicas gets a reference to the given int32 and assigns it to the Replicas field. +func (o *PartialUpdateInstancePayload) SetReplicas(v int32) { + o.Replicas = &v +} + +// GetStorage returns the Storage field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetStorage() StorageUpdate { + if o == nil || IsNil(o.Storage) { + var ret StorageUpdate + return ret + } + return *o.Storage +} + +// GetStorageOk returns a tuple with the Storage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetStorageOk() (*StorageUpdate, bool) { + if o == nil || IsNil(o.Storage) { + return nil, false + } + return o.Storage, true +} + +// HasStorage returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasStorage() bool { + if o != nil && !IsNil(o.Storage) { + return true + } + + return false +} + +// SetStorage gets a reference to the given StorageUpdate and assigns it to the Storage field. +func (o *PartialUpdateInstancePayload) SetStorage(v StorageUpdate) { + o.Storage = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetVersion() string { + if o == nil || IsNil(o.Version) { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetVersionOk() (*string, bool) { + if o == nil || IsNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasVersion() bool { + if o != nil && !IsNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *PartialUpdateInstancePayload) SetVersion(v string) { + o.Version = &v +} + +func (o PartialUpdateInstancePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PartialUpdateInstancePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Acl) { + toSerialize["acl"] = o.Acl + } + if !IsNil(o.BackupSchedule) { + toSerialize["backupSchedule"] = o.BackupSchedule + } + if !IsNil(o.FlavorId) { + toSerialize["flavorId"] = o.FlavorId + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Options) { + toSerialize["options"] = o.Options + } + if !IsNil(o.Replicas) { + toSerialize["replicas"] = o.Replicas + } + if !IsNil(o.Storage) { + toSerialize["storage"] = o.Storage + } + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + return toSerialize, nil +} + +type NullablePartialUpdateInstancePayload struct { + value *PartialUpdateInstancePayload + isSet bool +} + +func (v NullablePartialUpdateInstancePayload) Get() *PartialUpdateInstancePayload { + return v.value +} + +func (v *NullablePartialUpdateInstancePayload) Set(val *PartialUpdateInstancePayload) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateInstancePayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateInstancePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateInstancePayload(val *PartialUpdateInstancePayload) *NullablePartialUpdateInstancePayload { + return &NullablePartialUpdateInstancePayload{value: val, isSet: true} +} + +func (v NullablePartialUpdateInstancePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateInstancePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_partial_update_instance_response.go b/services/postgresflex/v1api/model_partial_update_instance_response.go new file mode 100644 index 000000000..a9c221d22 --- /dev/null +++ b/services/postgresflex/v1api/model_partial_update_instance_response.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the PartialUpdateInstanceResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateInstanceResponse{} + +// PartialUpdateInstanceResponse struct for PartialUpdateInstanceResponse +type PartialUpdateInstanceResponse struct { + Item *Instance `json:"item,omitempty"` +} + +// NewPartialUpdateInstanceResponse instantiates a new PartialUpdateInstanceResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPartialUpdateInstanceResponse() *PartialUpdateInstanceResponse { + this := PartialUpdateInstanceResponse{} + return &this +} + +// NewPartialUpdateInstanceResponseWithDefaults instantiates a new PartialUpdateInstanceResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPartialUpdateInstanceResponseWithDefaults() *PartialUpdateInstanceResponse { + this := PartialUpdateInstanceResponse{} + return &this +} + +// GetItem returns the Item field value if set, zero value otherwise. +func (o *PartialUpdateInstanceResponse) GetItem() Instance { + if o == nil || IsNil(o.Item) { + var ret Instance + return ret + } + return *o.Item +} + +// GetItemOk returns a tuple with the Item field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstanceResponse) GetItemOk() (*Instance, bool) { + if o == nil || IsNil(o.Item) { + return nil, false + } + return o.Item, true +} + +// HasItem returns a boolean if a field has been set. +func (o *PartialUpdateInstanceResponse) HasItem() bool { + if o != nil && !IsNil(o.Item) { + return true + } + + return false +} + +// SetItem gets a reference to the given Instance and assigns it to the Item field. +func (o *PartialUpdateInstanceResponse) SetItem(v Instance) { + o.Item = &v +} + +func (o PartialUpdateInstanceResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PartialUpdateInstanceResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Item) { + toSerialize["item"] = o.Item + } + return toSerialize, nil +} + +type NullablePartialUpdateInstanceResponse struct { + value *PartialUpdateInstanceResponse + isSet bool +} + +func (v NullablePartialUpdateInstanceResponse) Get() *PartialUpdateInstanceResponse { + return v.value +} + +func (v *NullablePartialUpdateInstanceResponse) Set(val *PartialUpdateInstanceResponse) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateInstanceResponse) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateInstanceResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateInstanceResponse(val *PartialUpdateInstanceResponse) *NullablePartialUpdateInstanceResponse { + return &NullablePartialUpdateInstanceResponse{value: val, isSet: true} +} + +func (v NullablePartialUpdateInstanceResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateInstanceResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_partial_update_user_payload.go b/services/postgresflex/v1api/model_partial_update_user_payload.go new file mode 100644 index 000000000..e302d2671 --- /dev/null +++ b/services/postgresflex/v1api/model_partial_update_user_payload.go @@ -0,0 +1,161 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the PartialUpdateUserPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateUserPayload{} + +// PartialUpdateUserPayload struct for PartialUpdateUserPayload +type PartialUpdateUserPayload struct { + Database *string `json:"database,omitempty"` + Roles []string `json:"roles,omitempty"` +} + +// NewPartialUpdateUserPayload instantiates a new PartialUpdateUserPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPartialUpdateUserPayload() *PartialUpdateUserPayload { + this := PartialUpdateUserPayload{} + return &this +} + +// NewPartialUpdateUserPayloadWithDefaults instantiates a new PartialUpdateUserPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPartialUpdateUserPayloadWithDefaults() *PartialUpdateUserPayload { + this := PartialUpdateUserPayload{} + return &this +} + +// GetDatabase returns the Database field value if set, zero value otherwise. +func (o *PartialUpdateUserPayload) GetDatabase() string { + if o == nil || IsNil(o.Database) { + var ret string + return ret + } + return *o.Database +} + +// GetDatabaseOk returns a tuple with the Database field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateUserPayload) GetDatabaseOk() (*string, bool) { + if o == nil || IsNil(o.Database) { + return nil, false + } + return o.Database, true +} + +// HasDatabase returns a boolean if a field has been set. +func (o *PartialUpdateUserPayload) HasDatabase() bool { + if o != nil && !IsNil(o.Database) { + return true + } + + return false +} + +// SetDatabase gets a reference to the given string and assigns it to the Database field. +func (o *PartialUpdateUserPayload) SetDatabase(v string) { + o.Database = &v +} + +// GetRoles returns the Roles field value if set, zero value otherwise. +func (o *PartialUpdateUserPayload) GetRoles() []string { + if o == nil || IsNil(o.Roles) { + var ret []string + return ret + } + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateUserPayload) GetRolesOk() ([]string, bool) { + if o == nil || IsNil(o.Roles) { + return nil, false + } + return o.Roles, true +} + +// HasRoles returns a boolean if a field has been set. +func (o *PartialUpdateUserPayload) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { + return true + } + + return false +} + +// SetRoles gets a reference to the given []string and assigns it to the Roles field. +func (o *PartialUpdateUserPayload) SetRoles(v []string) { + o.Roles = v +} + +func (o PartialUpdateUserPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PartialUpdateUserPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Database) { + toSerialize["database"] = o.Database + } + if !IsNil(o.Roles) { + toSerialize["roles"] = o.Roles + } + return toSerialize, nil +} + +type NullablePartialUpdateUserPayload struct { + value *PartialUpdateUserPayload + isSet bool +} + +func (v NullablePartialUpdateUserPayload) Get() *PartialUpdateUserPayload { + return v.value +} + +func (v *NullablePartialUpdateUserPayload) Set(val *PartialUpdateUserPayload) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateUserPayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateUserPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateUserPayload(val *PartialUpdateUserPayload) *NullablePartialUpdateUserPayload { + return &NullablePartialUpdateUserPayload{value: val, isSet: true} +} + +func (v NullablePartialUpdateUserPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateUserPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_postgres_database_parameter.go b/services/postgresflex/v1api/model_postgres_database_parameter.go new file mode 100644 index 000000000..b6b9f3e40 --- /dev/null +++ b/services/postgresflex/v1api/model_postgres_database_parameter.go @@ -0,0 +1,533 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the PostgresDatabaseParameter type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PostgresDatabaseParameter{} + +// PostgresDatabaseParameter struct for PostgresDatabaseParameter +type PostgresDatabaseParameter struct { + // Context of the parameter. + Context *string `json:"context,omitempty"` + // Datatype describes the type of data that is used in the Value field. + DataType *string `json:"dataType,omitempty"` + // DefaultValue for the value field. + DefaultValue *string `json:"defaultValue,omitempty"` + // Description of the parameter. + Description *string `json:"description,omitempty"` + // Edit shows if the user can change this value. + Edit *bool `json:"edit,omitempty"` + // MaxValue describes the highest possible value that can be set. + MaxValue *string `json:"maxValue,omitempty"` + // MinValue describes the lowest possible value that can be set. + MinValue *string `json:"minValue,omitempty"` + // Name of the parameter. + Name *string `json:"name,omitempty"` + // PendingRestart describes if a parameter change requires a restart of the server. + PendingRestart *bool `json:"pendingRestart,omitempty"` + // ResetValue for the value field af.ter a reset. + ResetValue *string `json:"resetValue,omitempty"` + // Unit if the parameter has a unit if not empty. + Unit *string `json:"unit,omitempty"` + // Value of this parameter. + Value *string `json:"value,omitempty"` +} + +// NewPostgresDatabaseParameter instantiates a new PostgresDatabaseParameter object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPostgresDatabaseParameter() *PostgresDatabaseParameter { + this := PostgresDatabaseParameter{} + return &this +} + +// NewPostgresDatabaseParameterWithDefaults instantiates a new PostgresDatabaseParameter object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPostgresDatabaseParameterWithDefaults() *PostgresDatabaseParameter { + this := PostgresDatabaseParameter{} + return &this +} + +// GetContext returns the Context field value if set, zero value otherwise. +func (o *PostgresDatabaseParameter) GetContext() string { + if o == nil || IsNil(o.Context) { + var ret string + return ret + } + return *o.Context +} + +// GetContextOk returns a tuple with the Context field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PostgresDatabaseParameter) GetContextOk() (*string, bool) { + if o == nil || IsNil(o.Context) { + return nil, false + } + return o.Context, true +} + +// HasContext returns a boolean if a field has been set. +func (o *PostgresDatabaseParameter) HasContext() bool { + if o != nil && !IsNil(o.Context) { + return true + } + + return false +} + +// SetContext gets a reference to the given string and assigns it to the Context field. +func (o *PostgresDatabaseParameter) SetContext(v string) { + o.Context = &v +} + +// GetDataType returns the DataType field value if set, zero value otherwise. +func (o *PostgresDatabaseParameter) GetDataType() string { + if o == nil || IsNil(o.DataType) { + var ret string + return ret + } + return *o.DataType +} + +// GetDataTypeOk returns a tuple with the DataType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PostgresDatabaseParameter) GetDataTypeOk() (*string, bool) { + if o == nil || IsNil(o.DataType) { + return nil, false + } + return o.DataType, true +} + +// HasDataType returns a boolean if a field has been set. +func (o *PostgresDatabaseParameter) HasDataType() bool { + if o != nil && !IsNil(o.DataType) { + return true + } + + return false +} + +// SetDataType gets a reference to the given string and assigns it to the DataType field. +func (o *PostgresDatabaseParameter) SetDataType(v string) { + o.DataType = &v +} + +// GetDefaultValue returns the DefaultValue field value if set, zero value otherwise. +func (o *PostgresDatabaseParameter) GetDefaultValue() string { + if o == nil || IsNil(o.DefaultValue) { + var ret string + return ret + } + return *o.DefaultValue +} + +// GetDefaultValueOk returns a tuple with the DefaultValue field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PostgresDatabaseParameter) GetDefaultValueOk() (*string, bool) { + if o == nil || IsNil(o.DefaultValue) { + return nil, false + } + return o.DefaultValue, true +} + +// HasDefaultValue returns a boolean if a field has been set. +func (o *PostgresDatabaseParameter) HasDefaultValue() bool { + if o != nil && !IsNil(o.DefaultValue) { + return true + } + + return false +} + +// SetDefaultValue gets a reference to the given string and assigns it to the DefaultValue field. +func (o *PostgresDatabaseParameter) SetDefaultValue(v string) { + o.DefaultValue = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PostgresDatabaseParameter) 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 *PostgresDatabaseParameter) 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 *PostgresDatabaseParameter) 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 *PostgresDatabaseParameter) SetDescription(v string) { + o.Description = &v +} + +// GetEdit returns the Edit field value if set, zero value otherwise. +func (o *PostgresDatabaseParameter) GetEdit() bool { + if o == nil || IsNil(o.Edit) { + var ret bool + return ret + } + return *o.Edit +} + +// GetEditOk returns a tuple with the Edit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PostgresDatabaseParameter) GetEditOk() (*bool, bool) { + if o == nil || IsNil(o.Edit) { + return nil, false + } + return o.Edit, true +} + +// HasEdit returns a boolean if a field has been set. +func (o *PostgresDatabaseParameter) HasEdit() bool { + if o != nil && !IsNil(o.Edit) { + return true + } + + return false +} + +// SetEdit gets a reference to the given bool and assigns it to the Edit field. +func (o *PostgresDatabaseParameter) SetEdit(v bool) { + o.Edit = &v +} + +// GetMaxValue returns the MaxValue field value if set, zero value otherwise. +func (o *PostgresDatabaseParameter) GetMaxValue() string { + if o == nil || IsNil(o.MaxValue) { + var ret string + return ret + } + return *o.MaxValue +} + +// GetMaxValueOk returns a tuple with the MaxValue field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PostgresDatabaseParameter) GetMaxValueOk() (*string, bool) { + if o == nil || IsNil(o.MaxValue) { + return nil, false + } + return o.MaxValue, true +} + +// HasMaxValue returns a boolean if a field has been set. +func (o *PostgresDatabaseParameter) HasMaxValue() bool { + if o != nil && !IsNil(o.MaxValue) { + return true + } + + return false +} + +// SetMaxValue gets a reference to the given string and assigns it to the MaxValue field. +func (o *PostgresDatabaseParameter) SetMaxValue(v string) { + o.MaxValue = &v +} + +// GetMinValue returns the MinValue field value if set, zero value otherwise. +func (o *PostgresDatabaseParameter) GetMinValue() string { + if o == nil || IsNil(o.MinValue) { + var ret string + return ret + } + return *o.MinValue +} + +// GetMinValueOk returns a tuple with the MinValue field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PostgresDatabaseParameter) GetMinValueOk() (*string, bool) { + if o == nil || IsNil(o.MinValue) { + return nil, false + } + return o.MinValue, true +} + +// HasMinValue returns a boolean if a field has been set. +func (o *PostgresDatabaseParameter) HasMinValue() bool { + if o != nil && !IsNil(o.MinValue) { + return true + } + + return false +} + +// SetMinValue gets a reference to the given string and assigns it to the MinValue field. +func (o *PostgresDatabaseParameter) SetMinValue(v string) { + o.MinValue = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PostgresDatabaseParameter) 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 *PostgresDatabaseParameter) 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 *PostgresDatabaseParameter) 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 *PostgresDatabaseParameter) SetName(v string) { + o.Name = &v +} + +// GetPendingRestart returns the PendingRestart field value if set, zero value otherwise. +func (o *PostgresDatabaseParameter) GetPendingRestart() bool { + if o == nil || IsNil(o.PendingRestart) { + var ret bool + return ret + } + return *o.PendingRestart +} + +// GetPendingRestartOk returns a tuple with the PendingRestart field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PostgresDatabaseParameter) GetPendingRestartOk() (*bool, bool) { + if o == nil || IsNil(o.PendingRestart) { + return nil, false + } + return o.PendingRestart, true +} + +// HasPendingRestart returns a boolean if a field has been set. +func (o *PostgresDatabaseParameter) HasPendingRestart() bool { + if o != nil && !IsNil(o.PendingRestart) { + return true + } + + return false +} + +// SetPendingRestart gets a reference to the given bool and assigns it to the PendingRestart field. +func (o *PostgresDatabaseParameter) SetPendingRestart(v bool) { + o.PendingRestart = &v +} + +// GetResetValue returns the ResetValue field value if set, zero value otherwise. +func (o *PostgresDatabaseParameter) GetResetValue() string { + if o == nil || IsNil(o.ResetValue) { + var ret string + return ret + } + return *o.ResetValue +} + +// GetResetValueOk returns a tuple with the ResetValue field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PostgresDatabaseParameter) GetResetValueOk() (*string, bool) { + if o == nil || IsNil(o.ResetValue) { + return nil, false + } + return o.ResetValue, true +} + +// HasResetValue returns a boolean if a field has been set. +func (o *PostgresDatabaseParameter) HasResetValue() bool { + if o != nil && !IsNil(o.ResetValue) { + return true + } + + return false +} + +// SetResetValue gets a reference to the given string and assigns it to the ResetValue field. +func (o *PostgresDatabaseParameter) SetResetValue(v string) { + o.ResetValue = &v +} + +// GetUnit returns the Unit field value if set, zero value otherwise. +func (o *PostgresDatabaseParameter) GetUnit() string { + if o == nil || IsNil(o.Unit) { + var ret string + return ret + } + return *o.Unit +} + +// GetUnitOk returns a tuple with the Unit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PostgresDatabaseParameter) GetUnitOk() (*string, bool) { + if o == nil || IsNil(o.Unit) { + return nil, false + } + return o.Unit, true +} + +// HasUnit returns a boolean if a field has been set. +func (o *PostgresDatabaseParameter) HasUnit() bool { + if o != nil && !IsNil(o.Unit) { + return true + } + + return false +} + +// SetUnit gets a reference to the given string and assigns it to the Unit field. +func (o *PostgresDatabaseParameter) SetUnit(v string) { + o.Unit = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *PostgresDatabaseParameter) GetValue() string { + if o == nil || IsNil(o.Value) { + var ret string + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PostgresDatabaseParameter) GetValueOk() (*string, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *PostgresDatabaseParameter) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given string and assigns it to the Value field. +func (o *PostgresDatabaseParameter) SetValue(v string) { + o.Value = &v +} + +func (o PostgresDatabaseParameter) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PostgresDatabaseParameter) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Context) { + toSerialize["context"] = o.Context + } + if !IsNil(o.DataType) { + toSerialize["dataType"] = o.DataType + } + if !IsNil(o.DefaultValue) { + toSerialize["defaultValue"] = o.DefaultValue + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Edit) { + toSerialize["edit"] = o.Edit + } + if !IsNil(o.MaxValue) { + toSerialize["maxValue"] = o.MaxValue + } + if !IsNil(o.MinValue) { + toSerialize["minValue"] = o.MinValue + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.PendingRestart) { + toSerialize["pendingRestart"] = o.PendingRestart + } + if !IsNil(o.ResetValue) { + toSerialize["resetValue"] = o.ResetValue + } + if !IsNil(o.Unit) { + toSerialize["unit"] = o.Unit + } + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + return toSerialize, nil +} + +type NullablePostgresDatabaseParameter struct { + value *PostgresDatabaseParameter + isSet bool +} + +func (v NullablePostgresDatabaseParameter) Get() *PostgresDatabaseParameter { + return v.value +} + +func (v *NullablePostgresDatabaseParameter) Set(val *PostgresDatabaseParameter) { + v.value = val + v.isSet = true +} + +func (v NullablePostgresDatabaseParameter) IsSet() bool { + return v.isSet +} + +func (v *NullablePostgresDatabaseParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePostgresDatabaseParameter(val *PostgresDatabaseParameter) *NullablePostgresDatabaseParameter { + return &NullablePostgresDatabaseParameter{value: val, isSet: true} +} + +func (v NullablePostgresDatabaseParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePostgresDatabaseParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_postgres_database_parameter_response.go b/services/postgresflex/v1api/model_postgres_database_parameter_response.go new file mode 100644 index 000000000..8bbec3afd --- /dev/null +++ b/services/postgresflex/v1api/model_postgres_database_parameter_response.go @@ -0,0 +1,126 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the PostgresDatabaseParameterResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PostgresDatabaseParameterResponse{} + +// PostgresDatabaseParameterResponse struct for PostgresDatabaseParameterResponse +type PostgresDatabaseParameterResponse struct { + // List of the parameter + Parameter []PostgresDatabaseParameter `json:"parameter,omitempty"` +} + +// NewPostgresDatabaseParameterResponse instantiates a new PostgresDatabaseParameterResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPostgresDatabaseParameterResponse() *PostgresDatabaseParameterResponse { + this := PostgresDatabaseParameterResponse{} + return &this +} + +// NewPostgresDatabaseParameterResponseWithDefaults instantiates a new PostgresDatabaseParameterResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPostgresDatabaseParameterResponseWithDefaults() *PostgresDatabaseParameterResponse { + this := PostgresDatabaseParameterResponse{} + return &this +} + +// GetParameter returns the Parameter field value if set, zero value otherwise. +func (o *PostgresDatabaseParameterResponse) GetParameter() []PostgresDatabaseParameter { + if o == nil || IsNil(o.Parameter) { + var ret []PostgresDatabaseParameter + return ret + } + return o.Parameter +} + +// GetParameterOk returns a tuple with the Parameter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PostgresDatabaseParameterResponse) GetParameterOk() ([]PostgresDatabaseParameter, bool) { + if o == nil || IsNil(o.Parameter) { + return nil, false + } + return o.Parameter, true +} + +// HasParameter returns a boolean if a field has been set. +func (o *PostgresDatabaseParameterResponse) HasParameter() bool { + if o != nil && !IsNil(o.Parameter) { + return true + } + + return false +} + +// SetParameter gets a reference to the given []PostgresDatabaseParameter and assigns it to the Parameter field. +func (o *PostgresDatabaseParameterResponse) SetParameter(v []PostgresDatabaseParameter) { + o.Parameter = v +} + +func (o PostgresDatabaseParameterResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PostgresDatabaseParameterResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Parameter) { + toSerialize["parameter"] = o.Parameter + } + return toSerialize, nil +} + +type NullablePostgresDatabaseParameterResponse struct { + value *PostgresDatabaseParameterResponse + isSet bool +} + +func (v NullablePostgresDatabaseParameterResponse) Get() *PostgresDatabaseParameterResponse { + return v.value +} + +func (v *NullablePostgresDatabaseParameterResponse) Set(val *PostgresDatabaseParameterResponse) { + v.value = val + v.isSet = true +} + +func (v NullablePostgresDatabaseParameterResponse) IsSet() bool { + return v.isSet +} + +func (v *NullablePostgresDatabaseParameterResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePostgresDatabaseParameterResponse(val *PostgresDatabaseParameterResponse) *NullablePostgresDatabaseParameterResponse { + return &NullablePostgresDatabaseParameterResponse{value: val, isSet: true} +} + +func (v NullablePostgresDatabaseParameterResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePostgresDatabaseParameterResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_reset_user_response.go b/services/postgresflex/v1api/model_reset_user_response.go new file mode 100644 index 000000000..0f5928f2c --- /dev/null +++ b/services/postgresflex/v1api/model_reset_user_response.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the ResetUserResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ResetUserResponse{} + +// ResetUserResponse struct for ResetUserResponse +type ResetUserResponse struct { + Item *User `json:"item,omitempty"` +} + +// NewResetUserResponse instantiates a new ResetUserResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewResetUserResponse() *ResetUserResponse { + this := ResetUserResponse{} + return &this +} + +// NewResetUserResponseWithDefaults instantiates a new ResetUserResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewResetUserResponseWithDefaults() *ResetUserResponse { + this := ResetUserResponse{} + return &this +} + +// GetItem returns the Item field value if set, zero value otherwise. +func (o *ResetUserResponse) GetItem() User { + if o == nil || IsNil(o.Item) { + var ret User + return ret + } + return *o.Item +} + +// GetItemOk returns a tuple with the Item field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResetUserResponse) GetItemOk() (*User, bool) { + if o == nil || IsNil(o.Item) { + return nil, false + } + return o.Item, true +} + +// HasItem returns a boolean if a field has been set. +func (o *ResetUserResponse) HasItem() bool { + if o != nil && !IsNil(o.Item) { + return true + } + + return false +} + +// SetItem gets a reference to the given User and assigns it to the Item field. +func (o *ResetUserResponse) SetItem(v User) { + o.Item = &v +} + +func (o ResetUserResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ResetUserResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Item) { + toSerialize["item"] = o.Item + } + return toSerialize, nil +} + +type NullableResetUserResponse struct { + value *ResetUserResponse + isSet bool +} + +func (v NullableResetUserResponse) Get() *ResetUserResponse { + return v.value +} + +func (v *NullableResetUserResponse) Set(val *ResetUserResponse) { + v.value = val + v.isSet = true +} + +func (v NullableResetUserResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableResetUserResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResetUserResponse(val *ResetUserResponse) *NullableResetUserResponse { + return &NullableResetUserResponse{value: val, isSet: true} +} + +func (v NullableResetUserResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResetUserResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_storage.go b/services/postgresflex/v1api/model_storage.go new file mode 100644 index 000000000..d3f53f707 --- /dev/null +++ b/services/postgresflex/v1api/model_storage.go @@ -0,0 +1,161 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the Storage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Storage{} + +// Storage struct for Storage +type Storage struct { + Class *string `json:"class,omitempty"` + Size *int64 `json:"size,omitempty"` +} + +// NewStorage instantiates a new Storage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStorage() *Storage { + this := Storage{} + return &this +} + +// NewStorageWithDefaults instantiates a new Storage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStorageWithDefaults() *Storage { + this := Storage{} + return &this +} + +// GetClass returns the Class field value if set, zero value otherwise. +func (o *Storage) GetClass() string { + if o == nil || IsNil(o.Class) { + var ret string + return ret + } + return *o.Class +} + +// GetClassOk returns a tuple with the Class field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Storage) GetClassOk() (*string, bool) { + if o == nil || IsNil(o.Class) { + return nil, false + } + return o.Class, true +} + +// HasClass returns a boolean if a field has been set. +func (o *Storage) HasClass() bool { + if o != nil && !IsNil(o.Class) { + return true + } + + return false +} + +// SetClass gets a reference to the given string and assigns it to the Class field. +func (o *Storage) SetClass(v string) { + o.Class = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *Storage) 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 *Storage) 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 *Storage) 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 *Storage) SetSize(v int64) { + o.Size = &v +} + +func (o Storage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Storage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Class) { + toSerialize["class"] = o.Class + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + return toSerialize, nil +} + +type NullableStorage struct { + value *Storage + isSet bool +} + +func (v NullableStorage) Get() *Storage { + return v.value +} + +func (v *NullableStorage) Set(val *Storage) { + v.value = val + v.isSet = true +} + +func (v NullableStorage) IsSet() bool { + return v.isSet +} + +func (v *NullableStorage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStorage(val *Storage) *NullableStorage { + return &NullableStorage{value: val, isSet: true} +} + +func (v NullableStorage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStorage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_storage_range.go b/services/postgresflex/v1api/model_storage_range.go new file mode 100644 index 000000000..ad88c0eae --- /dev/null +++ b/services/postgresflex/v1api/model_storage_range.go @@ -0,0 +1,161 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the StorageRange type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &StorageRange{} + +// StorageRange struct for StorageRange +type StorageRange struct { + Max *int32 `json:"max,omitempty"` + Min *int32 `json:"min,omitempty"` +} + +// NewStorageRange instantiates a new StorageRange object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStorageRange() *StorageRange { + this := StorageRange{} + return &this +} + +// NewStorageRangeWithDefaults instantiates a new StorageRange object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStorageRangeWithDefaults() *StorageRange { + this := StorageRange{} + return &this +} + +// GetMax returns the Max field value if set, zero value otherwise. +func (o *StorageRange) GetMax() int32 { + if o == nil || IsNil(o.Max) { + var ret int32 + return ret + } + return *o.Max +} + +// GetMaxOk returns a tuple with the Max field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StorageRange) GetMaxOk() (*int32, bool) { + if o == nil || IsNil(o.Max) { + return nil, false + } + return o.Max, true +} + +// HasMax returns a boolean if a field has been set. +func (o *StorageRange) HasMax() bool { + if o != nil && !IsNil(o.Max) { + return true + } + + return false +} + +// SetMax gets a reference to the given int32 and assigns it to the Max field. +func (o *StorageRange) SetMax(v int32) { + o.Max = &v +} + +// GetMin returns the Min field value if set, zero value otherwise. +func (o *StorageRange) GetMin() int32 { + if o == nil || IsNil(o.Min) { + var ret int32 + return ret + } + return *o.Min +} + +// GetMinOk returns a tuple with the Min field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StorageRange) GetMinOk() (*int32, bool) { + if o == nil || IsNil(o.Min) { + return nil, false + } + return o.Min, true +} + +// HasMin returns a boolean if a field has been set. +func (o *StorageRange) HasMin() bool { + if o != nil && !IsNil(o.Min) { + return true + } + + return false +} + +// SetMin gets a reference to the given int32 and assigns it to the Min field. +func (o *StorageRange) SetMin(v int32) { + o.Min = &v +} + +func (o StorageRange) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o StorageRange) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Max) { + toSerialize["max"] = o.Max + } + if !IsNil(o.Min) { + toSerialize["min"] = o.Min + } + return toSerialize, nil +} + +type NullableStorageRange struct { + value *StorageRange + isSet bool +} + +func (v NullableStorageRange) Get() *StorageRange { + return v.value +} + +func (v *NullableStorageRange) Set(val *StorageRange) { + v.value = val + v.isSet = true +} + +func (v NullableStorageRange) IsSet() bool { + return v.isSet +} + +func (v *NullableStorageRange) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStorageRange(val *StorageRange) *NullableStorageRange { + return &NullableStorageRange{value: val, isSet: true} +} + +func (v NullableStorageRange) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStorageRange) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_storage_update.go b/services/postgresflex/v1api/model_storage_update.go new file mode 100644 index 000000000..44a77963c --- /dev/null +++ b/services/postgresflex/v1api/model_storage_update.go @@ -0,0 +1,166 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the StorageUpdate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &StorageUpdate{} + +// StorageUpdate struct for StorageUpdate +type StorageUpdate struct { + // ⚠️ **DEPRECATED AND NON-FUNCTIONAL:** Updating the performance class field is not possible. + // Deprecated + Class *string `json:"class,omitempty"` + Size *int64 `json:"size,omitempty"` +} + +// NewStorageUpdate instantiates a new StorageUpdate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStorageUpdate() *StorageUpdate { + this := StorageUpdate{} + return &this +} + +// NewStorageUpdateWithDefaults instantiates a new StorageUpdate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStorageUpdateWithDefaults() *StorageUpdate { + this := StorageUpdate{} + return &this +} + +// GetClass returns the Class field value if set, zero value otherwise. +// Deprecated +func (o *StorageUpdate) GetClass() string { + if o == nil || IsNil(o.Class) { + var ret string + return ret + } + return *o.Class +} + +// GetClassOk returns a tuple with the Class field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *StorageUpdate) GetClassOk() (*string, bool) { + if o == nil || IsNil(o.Class) { + return nil, false + } + return o.Class, true +} + +// HasClass returns a boolean if a field has been set. +func (o *StorageUpdate) HasClass() bool { + if o != nil && !IsNil(o.Class) { + return true + } + + return false +} + +// SetClass gets a reference to the given string and assigns it to the Class field. +// Deprecated +func (o *StorageUpdate) SetClass(v string) { + o.Class = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *StorageUpdate) 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 *StorageUpdate) 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 *StorageUpdate) 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 *StorageUpdate) SetSize(v int64) { + o.Size = &v +} + +func (o StorageUpdate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o StorageUpdate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Class) { + toSerialize["class"] = o.Class + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + return toSerialize, nil +} + +type NullableStorageUpdate struct { + value *StorageUpdate + isSet bool +} + +func (v NullableStorageUpdate) Get() *StorageUpdate { + return v.value +} + +func (v *NullableStorageUpdate) Set(val *StorageUpdate) { + v.value = val + v.isSet = true +} + +func (v NullableStorageUpdate) IsSet() bool { + return v.isSet +} + +func (v *NullableStorageUpdate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStorageUpdate(val *StorageUpdate) *NullableStorageUpdate { + return &NullableStorageUpdate{value: val, isSet: true} +} + +func (v NullableStorageUpdate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStorageUpdate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_update_backup_schedule_payload.go b/services/postgresflex/v1api/model_update_backup_schedule_payload.go new file mode 100644 index 000000000..7e028c56b --- /dev/null +++ b/services/postgresflex/v1api/model_update_backup_schedule_payload.go @@ -0,0 +1,157 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the UpdateBackupSchedulePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateBackupSchedulePayload{} + +// UpdateBackupSchedulePayload struct for UpdateBackupSchedulePayload +type UpdateBackupSchedulePayload struct { + BackupSchedule string `json:"backupSchedule"` +} + +type _UpdateBackupSchedulePayload UpdateBackupSchedulePayload + +// NewUpdateBackupSchedulePayload instantiates a new UpdateBackupSchedulePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateBackupSchedulePayload(backupSchedule string) *UpdateBackupSchedulePayload { + this := UpdateBackupSchedulePayload{} + this.BackupSchedule = backupSchedule + return &this +} + +// NewUpdateBackupSchedulePayloadWithDefaults instantiates a new UpdateBackupSchedulePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateBackupSchedulePayloadWithDefaults() *UpdateBackupSchedulePayload { + this := UpdateBackupSchedulePayload{} + return &this +} + +// GetBackupSchedule returns the BackupSchedule field value +func (o *UpdateBackupSchedulePayload) GetBackupSchedule() string { + if o == nil { + var ret string + return ret + } + + return o.BackupSchedule +} + +// GetBackupScheduleOk returns a tuple with the BackupSchedule field value +// and a boolean to check if the value has been set. +func (o *UpdateBackupSchedulePayload) GetBackupScheduleOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BackupSchedule, true +} + +// SetBackupSchedule sets field value +func (o *UpdateBackupSchedulePayload) SetBackupSchedule(v string) { + o.BackupSchedule = v +} + +func (o UpdateBackupSchedulePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateBackupSchedulePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["backupSchedule"] = o.BackupSchedule + return toSerialize, nil +} + +func (o *UpdateBackupSchedulePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "backupSchedule", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUpdateBackupSchedulePayload := _UpdateBackupSchedulePayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varUpdateBackupSchedulePayload) + + if err != nil { + return err + } + + *o = UpdateBackupSchedulePayload(varUpdateBackupSchedulePayload) + + return err +} + +type NullableUpdateBackupSchedulePayload struct { + value *UpdateBackupSchedulePayload + isSet bool +} + +func (v NullableUpdateBackupSchedulePayload) Get() *UpdateBackupSchedulePayload { + return v.value +} + +func (v *NullableUpdateBackupSchedulePayload) Set(val *UpdateBackupSchedulePayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateBackupSchedulePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateBackupSchedulePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateBackupSchedulePayload(val *UpdateBackupSchedulePayload) *NullableUpdateBackupSchedulePayload { + return &NullableUpdateBackupSchedulePayload{value: val, isSet: true} +} + +func (v NullableUpdateBackupSchedulePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateBackupSchedulePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_update_instance_payload.go b/services/postgresflex/v1api/model_update_instance_payload.go new file mode 100644 index 000000000..82eb1b9ac --- /dev/null +++ b/services/postgresflex/v1api/model_update_instance_payload.go @@ -0,0 +1,414 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the UpdateInstancePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateInstancePayload{} + +// UpdateInstancePayload struct for UpdateInstancePayload +type UpdateInstancePayload struct { + Acl *ACL `json:"acl,omitempty"` + BackupSchedule *string `json:"backupSchedule,omitempty"` + FlavorId *string `json:"flavorId,omitempty"` + // Labels field is not certain/clear + Labels *map[string]string `json:"labels,omitempty"` + Name *string `json:"name,omitempty"` + Options *map[string]string `json:"options,omitempty"` + Replicas *int32 `json:"replicas,omitempty"` + Storage *StorageUpdate `json:"storage,omitempty"` + Version *string `json:"version,omitempty"` +} + +// NewUpdateInstancePayload instantiates a new UpdateInstancePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateInstancePayload() *UpdateInstancePayload { + this := UpdateInstancePayload{} + return &this +} + +// NewUpdateInstancePayloadWithDefaults instantiates a new UpdateInstancePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateInstancePayloadWithDefaults() *UpdateInstancePayload { + this := UpdateInstancePayload{} + return &this +} + +// GetAcl returns the Acl field value if set, zero value otherwise. +func (o *UpdateInstancePayload) GetAcl() ACL { + if o == nil || IsNil(o.Acl) { + var ret ACL + return ret + } + return *o.Acl +} + +// GetAclOk returns a tuple with the Acl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateInstancePayload) GetAclOk() (*ACL, bool) { + if o == nil || IsNil(o.Acl) { + return nil, false + } + return o.Acl, true +} + +// HasAcl returns a boolean if a field has been set. +func (o *UpdateInstancePayload) HasAcl() bool { + if o != nil && !IsNil(o.Acl) { + return true + } + + return false +} + +// SetAcl gets a reference to the given ACL and assigns it to the Acl field. +func (o *UpdateInstancePayload) SetAcl(v ACL) { + o.Acl = &v +} + +// GetBackupSchedule returns the BackupSchedule field value if set, zero value otherwise. +func (o *UpdateInstancePayload) GetBackupSchedule() string { + if o == nil || IsNil(o.BackupSchedule) { + var ret string + return ret + } + return *o.BackupSchedule +} + +// GetBackupScheduleOk returns a tuple with the BackupSchedule field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateInstancePayload) GetBackupScheduleOk() (*string, bool) { + if o == nil || IsNil(o.BackupSchedule) { + return nil, false + } + return o.BackupSchedule, true +} + +// HasBackupSchedule returns a boolean if a field has been set. +func (o *UpdateInstancePayload) HasBackupSchedule() bool { + if o != nil && !IsNil(o.BackupSchedule) { + return true + } + + return false +} + +// SetBackupSchedule gets a reference to the given string and assigns it to the BackupSchedule field. +func (o *UpdateInstancePayload) SetBackupSchedule(v string) { + o.BackupSchedule = &v +} + +// GetFlavorId returns the FlavorId field value if set, zero value otherwise. +func (o *UpdateInstancePayload) GetFlavorId() string { + if o == nil || IsNil(o.FlavorId) { + var ret string + return ret + } + return *o.FlavorId +} + +// GetFlavorIdOk returns a tuple with the FlavorId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateInstancePayload) GetFlavorIdOk() (*string, bool) { + if o == nil || IsNil(o.FlavorId) { + return nil, false + } + return o.FlavorId, true +} + +// HasFlavorId returns a boolean if a field has been set. +func (o *UpdateInstancePayload) HasFlavorId() bool { + if o != nil && !IsNil(o.FlavorId) { + return true + } + + return false +} + +// SetFlavorId gets a reference to the given string and assigns it to the FlavorId field. +func (o *UpdateInstancePayload) SetFlavorId(v string) { + o.FlavorId = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateInstancePayload) GetLabels() map[string]string { + if o == nil || IsNil(o.Labels) { + var ret map[string]string + 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 *UpdateInstancePayload) GetLabelsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Labels) { + return nil, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateInstancePayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *UpdateInstancePayload) SetLabels(v map[string]string) { + o.Labels = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateInstancePayload) 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 *UpdateInstancePayload) 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 *UpdateInstancePayload) 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 *UpdateInstancePayload) SetName(v string) { + o.Name = &v +} + +// GetOptions returns the Options field value if set, zero value otherwise. +func (o *UpdateInstancePayload) GetOptions() map[string]string { + if o == nil || IsNil(o.Options) { + var ret map[string]string + return ret + } + return *o.Options +} + +// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateInstancePayload) GetOptionsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Options) { + return nil, false + } + return o.Options, true +} + +// HasOptions returns a boolean if a field has been set. +func (o *UpdateInstancePayload) HasOptions() bool { + if o != nil && !IsNil(o.Options) { + return true + } + + return false +} + +// SetOptions gets a reference to the given map[string]string and assigns it to the Options field. +func (o *UpdateInstancePayload) SetOptions(v map[string]string) { + o.Options = &v +} + +// GetReplicas returns the Replicas field value if set, zero value otherwise. +func (o *UpdateInstancePayload) GetReplicas() int32 { + if o == nil || IsNil(o.Replicas) { + var ret int32 + return ret + } + return *o.Replicas +} + +// GetReplicasOk returns a tuple with the Replicas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateInstancePayload) GetReplicasOk() (*int32, bool) { + if o == nil || IsNil(o.Replicas) { + return nil, false + } + return o.Replicas, true +} + +// HasReplicas returns a boolean if a field has been set. +func (o *UpdateInstancePayload) HasReplicas() bool { + if o != nil && !IsNil(o.Replicas) { + return true + } + + return false +} + +// SetReplicas gets a reference to the given int32 and assigns it to the Replicas field. +func (o *UpdateInstancePayload) SetReplicas(v int32) { + o.Replicas = &v +} + +// GetStorage returns the Storage field value if set, zero value otherwise. +func (o *UpdateInstancePayload) GetStorage() StorageUpdate { + if o == nil || IsNil(o.Storage) { + var ret StorageUpdate + return ret + } + return *o.Storage +} + +// GetStorageOk returns a tuple with the Storage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateInstancePayload) GetStorageOk() (*StorageUpdate, bool) { + if o == nil || IsNil(o.Storage) { + return nil, false + } + return o.Storage, true +} + +// HasStorage returns a boolean if a field has been set. +func (o *UpdateInstancePayload) HasStorage() bool { + if o != nil && !IsNil(o.Storage) { + return true + } + + return false +} + +// SetStorage gets a reference to the given StorageUpdate and assigns it to the Storage field. +func (o *UpdateInstancePayload) SetStorage(v StorageUpdate) { + o.Storage = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *UpdateInstancePayload) GetVersion() string { + if o == nil || IsNil(o.Version) { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateInstancePayload) GetVersionOk() (*string, bool) { + if o == nil || IsNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *UpdateInstancePayload) HasVersion() bool { + if o != nil && !IsNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *UpdateInstancePayload) SetVersion(v string) { + o.Version = &v +} + +func (o UpdateInstancePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateInstancePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Acl) { + toSerialize["acl"] = o.Acl + } + if !IsNil(o.BackupSchedule) { + toSerialize["backupSchedule"] = o.BackupSchedule + } + if !IsNil(o.FlavorId) { + toSerialize["flavorId"] = o.FlavorId + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Options) { + toSerialize["options"] = o.Options + } + if !IsNil(o.Replicas) { + toSerialize["replicas"] = o.Replicas + } + if !IsNil(o.Storage) { + toSerialize["storage"] = o.Storage + } + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + return toSerialize, nil +} + +type NullableUpdateInstancePayload struct { + value *UpdateInstancePayload + isSet bool +} + +func (v NullableUpdateInstancePayload) Get() *UpdateInstancePayload { + return v.value +} + +func (v *NullableUpdateInstancePayload) Set(val *UpdateInstancePayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateInstancePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateInstancePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateInstancePayload(val *UpdateInstancePayload) *NullableUpdateInstancePayload { + return &NullableUpdateInstancePayload{value: val, isSet: true} +} + +func (v NullableUpdateInstancePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateInstancePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_update_user_payload.go b/services/postgresflex/v1api/model_update_user_payload.go new file mode 100644 index 000000000..db1bb0359 --- /dev/null +++ b/services/postgresflex/v1api/model_update_user_payload.go @@ -0,0 +1,161 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the UpdateUserPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateUserPayload{} + +// UpdateUserPayload struct for UpdateUserPayload +type UpdateUserPayload struct { + Database *string `json:"database,omitempty"` + Roles []string `json:"roles,omitempty"` +} + +// NewUpdateUserPayload instantiates a new UpdateUserPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateUserPayload() *UpdateUserPayload { + this := UpdateUserPayload{} + return &this +} + +// NewUpdateUserPayloadWithDefaults instantiates a new UpdateUserPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateUserPayloadWithDefaults() *UpdateUserPayload { + this := UpdateUserPayload{} + return &this +} + +// GetDatabase returns the Database field value if set, zero value otherwise. +func (o *UpdateUserPayload) GetDatabase() string { + if o == nil || IsNil(o.Database) { + var ret string + return ret + } + return *o.Database +} + +// GetDatabaseOk returns a tuple with the Database field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateUserPayload) GetDatabaseOk() (*string, bool) { + if o == nil || IsNil(o.Database) { + return nil, false + } + return o.Database, true +} + +// HasDatabase returns a boolean if a field has been set. +func (o *UpdateUserPayload) HasDatabase() bool { + if o != nil && !IsNil(o.Database) { + return true + } + + return false +} + +// SetDatabase gets a reference to the given string and assigns it to the Database field. +func (o *UpdateUserPayload) SetDatabase(v string) { + o.Database = &v +} + +// GetRoles returns the Roles field value if set, zero value otherwise. +func (o *UpdateUserPayload) GetRoles() []string { + if o == nil || IsNil(o.Roles) { + var ret []string + return ret + } + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateUserPayload) GetRolesOk() ([]string, bool) { + if o == nil || IsNil(o.Roles) { + return nil, false + } + return o.Roles, true +} + +// HasRoles returns a boolean if a field has been set. +func (o *UpdateUserPayload) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { + return true + } + + return false +} + +// SetRoles gets a reference to the given []string and assigns it to the Roles field. +func (o *UpdateUserPayload) SetRoles(v []string) { + o.Roles = v +} + +func (o UpdateUserPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateUserPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Database) { + toSerialize["database"] = o.Database + } + if !IsNil(o.Roles) { + toSerialize["roles"] = o.Roles + } + return toSerialize, nil +} + +type NullableUpdateUserPayload struct { + value *UpdateUserPayload + isSet bool +} + +func (v NullableUpdateUserPayload) Get() *UpdateUserPayload { + return v.value +} + +func (v *NullableUpdateUserPayload) Set(val *UpdateUserPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateUserPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateUserPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateUserPayload(val *UpdateUserPayload) *NullableUpdateUserPayload { + return &NullableUpdateUserPayload{value: val, isSet: true} +} + +func (v NullableUpdateUserPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateUserPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_user.go b/services/postgresflex/v1api/model_user.go new file mode 100644 index 000000000..567b2242f --- /dev/null +++ b/services/postgresflex/v1api/model_user.go @@ -0,0 +1,377 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the User type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &User{} + +// User struct for User +type User struct { + Database *string `json:"database,omitempty"` + Host *string `json:"host,omitempty"` + Id *string `json:"id,omitempty"` + Password *string `json:"password,omitempty"` + Port *int32 `json:"port,omitempty"` + Roles []string `json:"roles,omitempty"` + Uri *string `json:"uri,omitempty"` + Username *string `json:"username,omitempty"` +} + +// NewUser instantiates a new User object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUser() *User { + this := User{} + return &this +} + +// NewUserWithDefaults instantiates a new User object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserWithDefaults() *User { + this := User{} + return &this +} + +// GetDatabase returns the Database field value if set, zero value otherwise. +func (o *User) GetDatabase() string { + if o == nil || IsNil(o.Database) { + var ret string + return ret + } + return *o.Database +} + +// GetDatabaseOk returns a tuple with the Database field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetDatabaseOk() (*string, bool) { + if o == nil || IsNil(o.Database) { + return nil, false + } + return o.Database, true +} + +// HasDatabase returns a boolean if a field has been set. +func (o *User) HasDatabase() bool { + if o != nil && !IsNil(o.Database) { + return true + } + + return false +} + +// SetDatabase gets a reference to the given string and assigns it to the Database field. +func (o *User) SetDatabase(v string) { + o.Database = &v +} + +// GetHost returns the Host field value if set, zero value otherwise. +func (o *User) GetHost() string { + if o == nil || IsNil(o.Host) { + var ret string + return ret + } + return *o.Host +} + +// GetHostOk returns a tuple with the Host field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetHostOk() (*string, bool) { + if o == nil || IsNil(o.Host) { + return nil, false + } + return o.Host, true +} + +// HasHost returns a boolean if a field has been set. +func (o *User) HasHost() bool { + if o != nil && !IsNil(o.Host) { + return true + } + + return false +} + +// SetHost gets a reference to the given string and assigns it to the Host field. +func (o *User) SetHost(v string) { + o.Host = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *User) 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 *User) 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 *User) 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 *User) SetId(v string) { + o.Id = &v +} + +// GetPassword returns the Password field value if set, zero value otherwise. +func (o *User) GetPassword() string { + if o == nil || IsNil(o.Password) { + var ret string + return ret + } + return *o.Password +} + +// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetPasswordOk() (*string, bool) { + if o == nil || IsNil(o.Password) { + return nil, false + } + return o.Password, true +} + +// HasPassword returns a boolean if a field has been set. +func (o *User) HasPassword() bool { + if o != nil && !IsNil(o.Password) { + return true + } + + return false +} + +// SetPassword gets a reference to the given string and assigns it to the Password field. +func (o *User) SetPassword(v string) { + o.Password = &v +} + +// GetPort returns the Port field value if set, zero value otherwise. +func (o *User) GetPort() int32 { + if o == nil || IsNil(o.Port) { + var ret int32 + return ret + } + return *o.Port +} + +// GetPortOk returns a tuple with the Port field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetPortOk() (*int32, bool) { + if o == nil || IsNil(o.Port) { + return nil, false + } + return o.Port, true +} + +// HasPort returns a boolean if a field has been set. +func (o *User) HasPort() bool { + if o != nil && !IsNil(o.Port) { + return true + } + + return false +} + +// SetPort gets a reference to the given int32 and assigns it to the Port field. +func (o *User) SetPort(v int32) { + o.Port = &v +} + +// GetRoles returns the Roles field value if set, zero value otherwise. +func (o *User) GetRoles() []string { + if o == nil || IsNil(o.Roles) { + var ret []string + return ret + } + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetRolesOk() ([]string, bool) { + if o == nil || IsNil(o.Roles) { + return nil, false + } + return o.Roles, true +} + +// HasRoles returns a boolean if a field has been set. +func (o *User) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { + return true + } + + return false +} + +// SetRoles gets a reference to the given []string and assigns it to the Roles field. +func (o *User) SetRoles(v []string) { + o.Roles = v +} + +// GetUri returns the Uri field value if set, zero value otherwise. +func (o *User) GetUri() string { + if o == nil || IsNil(o.Uri) { + var ret string + return ret + } + return *o.Uri +} + +// GetUriOk returns a tuple with the Uri field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetUriOk() (*string, bool) { + if o == nil || IsNil(o.Uri) { + return nil, false + } + return o.Uri, true +} + +// HasUri returns a boolean if a field has been set. +func (o *User) HasUri() bool { + if o != nil && !IsNil(o.Uri) { + return true + } + + return false +} + +// SetUri gets a reference to the given string and assigns it to the Uri field. +func (o *User) SetUri(v string) { + o.Uri = &v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *User) GetUsername() string { + if o == nil || IsNil(o.Username) { + var ret string + return ret + } + return *o.Username +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetUsernameOk() (*string, bool) { + if o == nil || IsNil(o.Username) { + return nil, false + } + return o.Username, true +} + +// HasUsername returns a boolean if a field has been set. +func (o *User) HasUsername() bool { + if o != nil && !IsNil(o.Username) { + return true + } + + return false +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *User) SetUsername(v string) { + o.Username = &v +} + +func (o User) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o User) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Database) { + toSerialize["database"] = o.Database + } + if !IsNil(o.Host) { + toSerialize["host"] = o.Host + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Password) { + toSerialize["password"] = o.Password + } + if !IsNil(o.Port) { + toSerialize["port"] = o.Port + } + if !IsNil(o.Roles) { + toSerialize["roles"] = o.Roles + } + if !IsNil(o.Uri) { + toSerialize["uri"] = o.Uri + } + if !IsNil(o.Username) { + toSerialize["username"] = o.Username + } + return toSerialize, nil +} + +type NullableUser struct { + value *User + isSet bool +} + +func (v NullableUser) Get() *User { + return v.value +} + +func (v *NullableUser) Set(val *User) { + v.value = val + v.isSet = true +} + +func (v NullableUser) IsSet() bool { + return v.isSet +} + +func (v *NullableUser) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUser(val *User) *NullableUser { + return &NullableUser{value: val, isSet: true} +} + +func (v NullableUser) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUser) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/model_user_response.go b/services/postgresflex/v1api/model_user_response.go new file mode 100644 index 000000000..133c2baaf --- /dev/null +++ b/services/postgresflex/v1api/model_user_response.go @@ -0,0 +1,269 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the UserResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserResponse{} + +// UserResponse struct for UserResponse +type UserResponse struct { + Host *string `json:"host,omitempty"` + Id *string `json:"id,omitempty"` + Port *int32 `json:"port,omitempty"` + Roles []string `json:"roles,omitempty"` + Username *string `json:"username,omitempty"` +} + +// NewUserResponse instantiates a new UserResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserResponse() *UserResponse { + this := UserResponse{} + return &this +} + +// NewUserResponseWithDefaults instantiates a new UserResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserResponseWithDefaults() *UserResponse { + this := UserResponse{} + return &this +} + +// GetHost returns the Host field value if set, zero value otherwise. +func (o *UserResponse) GetHost() string { + if o == nil || IsNil(o.Host) { + var ret string + return ret + } + return *o.Host +} + +// GetHostOk returns a tuple with the Host field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserResponse) GetHostOk() (*string, bool) { + if o == nil || IsNil(o.Host) { + return nil, false + } + return o.Host, true +} + +// HasHost returns a boolean if a field has been set. +func (o *UserResponse) HasHost() bool { + if o != nil && !IsNil(o.Host) { + return true + } + + return false +} + +// SetHost gets a reference to the given string and assigns it to the Host field. +func (o *UserResponse) SetHost(v string) { + o.Host = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *UserResponse) 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 *UserResponse) 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 *UserResponse) 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 *UserResponse) SetId(v string) { + o.Id = &v +} + +// GetPort returns the Port field value if set, zero value otherwise. +func (o *UserResponse) GetPort() int32 { + if o == nil || IsNil(o.Port) { + var ret int32 + return ret + } + return *o.Port +} + +// GetPortOk returns a tuple with the Port field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserResponse) GetPortOk() (*int32, bool) { + if o == nil || IsNil(o.Port) { + return nil, false + } + return o.Port, true +} + +// HasPort returns a boolean if a field has been set. +func (o *UserResponse) HasPort() bool { + if o != nil && !IsNil(o.Port) { + return true + } + + return false +} + +// SetPort gets a reference to the given int32 and assigns it to the Port field. +func (o *UserResponse) SetPort(v int32) { + o.Port = &v +} + +// GetRoles returns the Roles field value if set, zero value otherwise. +func (o *UserResponse) GetRoles() []string { + if o == nil || IsNil(o.Roles) { + var ret []string + return ret + } + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserResponse) GetRolesOk() ([]string, bool) { + if o == nil || IsNil(o.Roles) { + return nil, false + } + return o.Roles, true +} + +// HasRoles returns a boolean if a field has been set. +func (o *UserResponse) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { + return true + } + + return false +} + +// SetRoles gets a reference to the given []string and assigns it to the Roles field. +func (o *UserResponse) SetRoles(v []string) { + o.Roles = v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *UserResponse) GetUsername() string { + if o == nil || IsNil(o.Username) { + var ret string + return ret + } + return *o.Username +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserResponse) GetUsernameOk() (*string, bool) { + if o == nil || IsNil(o.Username) { + return nil, false + } + return o.Username, true +} + +// HasUsername returns a boolean if a field has been set. +func (o *UserResponse) HasUsername() bool { + if o != nil && !IsNil(o.Username) { + return true + } + + return false +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *UserResponse) SetUsername(v string) { + o.Username = &v +} + +func (o UserResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Host) { + toSerialize["host"] = o.Host + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Port) { + toSerialize["port"] = o.Port + } + if !IsNil(o.Roles) { + toSerialize["roles"] = o.Roles + } + if !IsNil(o.Username) { + toSerialize["username"] = o.Username + } + return toSerialize, nil +} + +type NullableUserResponse struct { + value *UserResponse + isSet bool +} + +func (v NullableUserResponse) Get() *UserResponse { + return v.value +} + +func (v *NullableUserResponse) Set(val *UserResponse) { + v.value = val + v.isSet = true +} + +func (v NullableUserResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableUserResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserResponse(val *UserResponse) *NullableUserResponse { + return &NullableUserResponse{value: val, isSet: true} +} + +func (v NullableUserResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v1api/response.go b/services/postgresflex/v1api/response.go new file mode 100644 index 000000000..996b1cace --- /dev/null +++ b/services/postgresflex/v1api/response.go @@ -0,0 +1,48 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// 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/postgresflex/v1api/utils.go b/services/postgresflex/v1api/utils.go new file mode 100644 index 000000000..936261640 --- /dev/null +++ b/services/postgresflex/v1api/utils.go @@ -0,0 +1,362 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// 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/postgresflex/v2api/api_default.go b/services/postgresflex/v2api/api_default.go new file mode 100644 index 000000000..a4e3f70c4 --- /dev/null +++ b/services/postgresflex/v2api/api_default.go @@ -0,0 +1,4484 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// 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 { + + /* + CloneInstance Clone Instance + + Clone an existing instance of a postgres database to a new destination instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @param instanceId Instance ID + @return ApiCloneInstanceRequest + */ + CloneInstance(ctx context.Context, projectId string, region string, instanceId string) ApiCloneInstanceRequest + + // CloneInstanceExecute executes the request + // @return CloneInstanceResponse + CloneInstanceExecute(r ApiCloneInstanceRequest) (*CloneInstanceResponse, error) + + /* + CreateDatabase Create Database + + Create database for a user + Note: The name of a valid user must be provided in the "options" map field using the key "owner" + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @param instanceId Instance ID + @return ApiCreateDatabaseRequest + */ + CreateDatabase(ctx context.Context, projectId string, region string, instanceId string) ApiCreateDatabaseRequest + + // CreateDatabaseExecute executes the request + // @return InstanceCreateDatabaseResponse + CreateDatabaseExecute(r ApiCreateDatabaseRequest) (*InstanceCreateDatabaseResponse, error) + + /* + CreateInstance Create Instance + + Create a new instance of a postgres database + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @return ApiCreateInstanceRequest + */ + CreateInstance(ctx context.Context, projectId string, region string) ApiCreateInstanceRequest + + // CreateInstanceExecute executes the request + // @return CreateInstanceResponse + CreateInstanceExecute(r ApiCreateInstanceRequest) (*CreateInstanceResponse, error) + + /* + CreateUser Create User + + Create user for an instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @param instanceId Instance ID + @return ApiCreateUserRequest + */ + CreateUser(ctx context.Context, projectId string, region string, instanceId string) ApiCreateUserRequest + + // CreateUserExecute executes the request + // @return CreateUserResponse + CreateUserExecute(r ApiCreateUserRequest) (*CreateUserResponse, error) + + /* + DeleteDatabase Delete Database + + Delete database for an instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @param instanceId Instance ID + @param databaseId Database ID + @return ApiDeleteDatabaseRequest + */ + DeleteDatabase(ctx context.Context, projectId string, region string, instanceId string, databaseId string) ApiDeleteDatabaseRequest + + // DeleteDatabaseExecute executes the request + DeleteDatabaseExecute(r ApiDeleteDatabaseRequest) error + + /* + DeleteInstance Delete Instance + + Delete available instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @param instanceId Instance ID + @return ApiDeleteInstanceRequest + */ + DeleteInstance(ctx context.Context, projectId string, region string, instanceId string) ApiDeleteInstanceRequest + + // DeleteInstanceExecute executes the request + DeleteInstanceExecute(r ApiDeleteInstanceRequest) error + + /* + DeleteUser Delete User + + Delete user for an instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @param instanceId Instance ID + @param userId User ID + @return ApiDeleteUserRequest + */ + DeleteUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiDeleteUserRequest + + // DeleteUserExecute executes the request + DeleteUserExecute(r ApiDeleteUserRequest) error + + /* + ForceDeleteInstance Force delete instance + + Forces the deletion of an delayed deleted instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @param instanceId Instance ID + @return ApiForceDeleteInstanceRequest + */ + ForceDeleteInstance(ctx context.Context, projectId string, region string, instanceId string) ApiForceDeleteInstanceRequest + + // ForceDeleteInstanceExecute executes the request + ForceDeleteInstanceExecute(r ApiForceDeleteInstanceRequest) error + + /* + GetBackup Get specific backup + + Get specific available backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @param instanceId Instance ID + @param backupId Backup ID + @return ApiGetBackupRequest + */ + GetBackup(ctx context.Context, projectId string, region string, instanceId string, backupId string) ApiGetBackupRequest + + // GetBackupExecute executes the request + // @return GetBackupResponse + GetBackupExecute(r ApiGetBackupRequest) (*GetBackupResponse, error) + + /* + GetInstance Get specific instance + + Get specific available instances + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @param instanceId Instance ID + @return ApiGetInstanceRequest + */ + GetInstance(ctx context.Context, projectId string, region string, instanceId string) ApiGetInstanceRequest + + // GetInstanceExecute executes the request + // @return InstanceResponse + GetInstanceExecute(r ApiGetInstanceRequest) (*InstanceResponse, error) + + /* + GetUser Get User + + Get specific available user for an instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @param instanceId Instance ID + @param userId User ID + @return ApiGetUserRequest + */ + GetUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiGetUserRequest + + // GetUserExecute executes the request + // @return GetUserResponse + GetUserExecute(r ApiGetUserRequest) (*GetUserResponse, error) + + /* + ListBackups List backups + + List all backups which are available for a specific instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @param instanceId Instance ID + @return ApiListBackupsRequest + */ + ListBackups(ctx context.Context, projectId string, region string, instanceId string) ApiListBackupsRequest + + // ListBackupsExecute executes the request + // @return ListBackupsResponse + ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupsResponse, error) + + /* + ListDatabaseParameters List Databases parameter + + List available databases parameter + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @param instanceId Instance ID + @return ApiListDatabaseParametersRequest + */ + ListDatabaseParameters(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabaseParametersRequest + + // ListDatabaseParametersExecute executes the request + // @return PostgresDatabaseParameterResponse + ListDatabaseParametersExecute(r ApiListDatabaseParametersRequest) (*PostgresDatabaseParameterResponse, error) + + /* + ListDatabases List Databases + + List available databases for an instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @param instanceId Instance ID + @return ApiListDatabasesRequest + */ + ListDatabases(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabasesRequest + + // ListDatabasesExecute executes the request + // @return InstanceListDatabasesResponse + ListDatabasesExecute(r ApiListDatabasesRequest) (*InstanceListDatabasesResponse, error) + + /* + ListFlavors Get Flavors + + Get available flavors for a specific projectID + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @return ApiListFlavorsRequest + */ + ListFlavors(ctx context.Context, projectId string, region string) ApiListFlavorsRequest + + // ListFlavorsExecute executes the request + // @return ListFlavorsResponse + ListFlavorsExecute(r ApiListFlavorsRequest) (*ListFlavorsResponse, error) + + /* + ListInstances List Instances + + List available instances + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @return ApiListInstancesRequest + */ + ListInstances(ctx context.Context, projectId string, region string) ApiListInstancesRequest + + // ListInstancesExecute executes the request + // @return ListInstancesResponse + ListInstancesExecute(r ApiListInstancesRequest) (*ListInstancesResponse, error) + + /* + ListMetrics Get Metric + + Returns a metric for an instance. The metric will only be for the master pod if needed. Granularity parameter is always needed. If start and end time is provided, period is not considered in max-connections and disk-use. If you provide start time, you have to provide end time as well and vice versa. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The UUID of the project. + @param region The region which should be addressed + @param instanceId The UUID of the instance. + @param metric The name of the metric. Valid metrics are 'cpu', 'memory', 'max-connections', 'connections' and 'disk-use'. + @return ApiListMetricsRequest + */ + ListMetrics(ctx context.Context, projectId string, region string, instanceId string, metric string) ApiListMetricsRequest + + // ListMetricsExecute executes the request + // @return InstanceMetricsResponse + ListMetricsExecute(r ApiListMetricsRequest) (*InstanceMetricsResponse, error) + + /* + ListStorages Get Storages + + Get available storages for a specific flavor + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @param flavorId Flavor ID + @return ApiListStoragesRequest + */ + ListStorages(ctx context.Context, projectId string, region string, flavorId string) ApiListStoragesRequest + + // ListStoragesExecute executes the request + // @return ListStoragesResponse + ListStoragesExecute(r ApiListStoragesRequest) (*ListStoragesResponse, error) + + /* + ListUsers List Users + + List available users for an instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @param instanceId Instance ID + @return ApiListUsersRequest + */ + ListUsers(ctx context.Context, projectId string, region string, instanceId string) ApiListUsersRequest + + // ListUsersExecute executes the request + // @return ListUsersResponse + ListUsersExecute(r ApiListUsersRequest) (*ListUsersResponse, error) + + /* + ListVersions Get Versions + + Get available versions for postgres database + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @return ApiListVersionsRequest + */ + ListVersions(ctx context.Context, projectId string, region string) ApiListVersionsRequest + + // ListVersionsExecute executes the request + // @return ListVersionsResponse + ListVersionsExecute(r ApiListVersionsRequest) (*ListVersionsResponse, error) + + /* + PartialUpdateInstance Update Instance + + Update available instance of a postgres database. Supported Versions are 12, 13, 14, 15 -- only upgrades are allowed! + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @param instanceId Instance ID + @return ApiPartialUpdateInstanceRequest + */ + PartialUpdateInstance(ctx context.Context, projectId string, region string, instanceId string) ApiPartialUpdateInstanceRequest + + // PartialUpdateInstanceExecute executes the request + // @return PartialUpdateInstanceResponse + PartialUpdateInstanceExecute(r ApiPartialUpdateInstanceRequest) (*PartialUpdateInstanceResponse, error) + + /* + PartialUpdateUser Update User + + Update user for an instance. Only the roles are updatable. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The ID of the project + @param region The region which should be addressed + @param instanceId The ID of the instance + @param userId The ID of the user in the database + @return ApiPartialUpdateUserRequest + */ + PartialUpdateUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiPartialUpdateUserRequest + + // PartialUpdateUserExecute executes the request + PartialUpdateUserExecute(r ApiPartialUpdateUserRequest) error + + /* + ResetUser Reset User + + Reset user password for a postgres instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @param instanceId Instance ID + @param userId user ID + @return ApiResetUserRequest + */ + ResetUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiResetUserRequest + + // ResetUserExecute executes the request + // @return ResetUserResponse + ResetUserExecute(r ApiResetUserRequest) (*ResetUserResponse, error) + + /* + UpdateBackupSchedule Update Backup Schedule + + Update backup schedule + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @param instanceId Instance ID + @return ApiUpdateBackupScheduleRequest + */ + UpdateBackupSchedule(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateBackupScheduleRequest + + // UpdateBackupScheduleExecute executes the request + UpdateBackupScheduleExecute(r ApiUpdateBackupScheduleRequest) error + + /* + UpdateInstance Update Instance + + Update available instance of a postgres database. Supported Versions are 12, 13, 14, 15 -- only upgrades are allowed! + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @param instanceId Instance ID + @return ApiUpdateInstanceRequest + */ + UpdateInstance(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceRequest + + // UpdateInstanceExecute executes the request + // @return PartialUpdateInstanceResponse + UpdateInstanceExecute(r ApiUpdateInstanceRequest) (*PartialUpdateInstanceResponse, error) + + /* + UpdateUser Update User + + Update user for an instance. Only the roles are updatable. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The ID of the project + @param region The region which should be addressed + @param instanceId The ID of the instance + @param userId The ID of the user in the database + @return ApiUpdateUserRequest + */ + UpdateUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiUpdateUserRequest + + // UpdateUserExecute executes the request + UpdateUserExecute(r ApiUpdateUserRequest) error +} + +// DefaultAPIService DefaultAPI service +type DefaultAPIService service + +type ApiCloneInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + cloneInstancePayload *CloneInstancePayload +} + +// Body +func (r ApiCloneInstanceRequest) CloneInstancePayload(cloneInstancePayload CloneInstancePayload) ApiCloneInstanceRequest { + r.cloneInstancePayload = &cloneInstancePayload + return r +} + +func (r ApiCloneInstanceRequest) Execute() (*CloneInstanceResponse, error) { + return r.ApiService.CloneInstanceExecute(r) +} + +/* +CloneInstance Clone Instance + +Clone an existing instance of a postgres database to a new destination instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @param instanceId Instance ID + @return ApiCloneInstanceRequest +*/ +func (a *DefaultAPIService) CloneInstance(ctx context.Context, projectId string, region string, instanceId string) ApiCloneInstanceRequest { + return ApiCloneInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return CloneInstanceResponse +func (a *DefaultAPIService) CloneInstanceExecute(r ApiCloneInstanceRequest) (*CloneInstanceResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CloneInstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CloneInstance") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/clone" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.cloneInstancePayload == nil { + return localVarReturnValue, reportError("cloneInstancePayload 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.cloneInstancePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateDatabaseRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + createDatabasePayload *CreateDatabasePayload +} + +// body +func (r ApiCreateDatabaseRequest) CreateDatabasePayload(createDatabasePayload CreateDatabasePayload) ApiCreateDatabaseRequest { + r.createDatabasePayload = &createDatabasePayload + return r +} + +func (r ApiCreateDatabaseRequest) Execute() (*InstanceCreateDatabaseResponse, error) { + return r.ApiService.CreateDatabaseExecute(r) +} + +/* +CreateDatabase Create Database + +Create database for a user +Note: The name of a valid user must be provided in the "options" map field using the key "owner" + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @param instanceId Instance ID + @return ApiCreateDatabaseRequest +*/ +func (a *DefaultAPIService) CreateDatabase(ctx context.Context, projectId string, region string, instanceId string) ApiCreateDatabaseRequest { + return ApiCreateDatabaseRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return InstanceCreateDatabaseResponse +func (a *DefaultAPIService) CreateDatabaseExecute(r ApiCreateDatabaseRequest) (*InstanceCreateDatabaseResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InstanceCreateDatabaseResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateDatabase") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/databases" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createDatabasePayload == nil { + return localVarReturnValue, reportError("createDatabasePayload 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.createDatabasePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + createInstancePayload *CreateInstancePayload +} + +// Body +func (r ApiCreateInstanceRequest) CreateInstancePayload(createInstancePayload CreateInstancePayload) ApiCreateInstanceRequest { + r.createInstancePayload = &createInstancePayload + return r +} + +func (r ApiCreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { + return r.ApiService.CreateInstanceExecute(r) +} + +/* +CreateInstance Create Instance + +Create a new instance of a postgres database + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @return ApiCreateInstanceRequest +*/ +func (a *DefaultAPIService) CreateInstance(ctx context.Context, projectId string, region string) ApiCreateInstanceRequest { + return ApiCreateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return CreateInstanceResponse +func (a *DefaultAPIService) CreateInstanceExecute(r ApiCreateInstanceRequest) (*CreateInstanceResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateInstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateInstance") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances" + 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 r.createInstancePayload == nil { + return localVarReturnValue, reportError("createInstancePayload 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.createInstancePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateUserRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + createUserPayload *CreateUserPayload +} + +// body +func (r ApiCreateUserRequest) CreateUserPayload(createUserPayload CreateUserPayload) ApiCreateUserRequest { + r.createUserPayload = &createUserPayload + return r +} + +func (r ApiCreateUserRequest) Execute() (*CreateUserResponse, error) { + return r.ApiService.CreateUserExecute(r) +} + +/* +CreateUser Create User + +Create user for an instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @param instanceId Instance ID + @return ApiCreateUserRequest +*/ +func (a *DefaultAPIService) CreateUser(ctx context.Context, projectId string, region string, instanceId string) ApiCreateUserRequest { + return ApiCreateUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return CreateUserResponse +func (a *DefaultAPIService) CreateUserExecute(r ApiCreateUserRequest) (*CreateUserResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateUserResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateUser") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createUserPayload == nil { + return localVarReturnValue, reportError("createUserPayload 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.createUserPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiDeleteDatabaseRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + databaseId string +} + +func (r ApiDeleteDatabaseRequest) Execute() error { + return r.ApiService.DeleteDatabaseExecute(r) +} + +/* +DeleteDatabase Delete Database + +Delete database for an instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @param instanceId Instance ID + @param databaseId Database ID + @return ApiDeleteDatabaseRequest +*/ +func (a *DefaultAPIService) DeleteDatabase(ctx context.Context, projectId string, region string, instanceId string, databaseId string) ApiDeleteDatabaseRequest { + return ApiDeleteDatabaseRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + databaseId: databaseId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteDatabaseExecute(r ApiDeleteDatabaseRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteDatabase") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/databases/{databaseId}" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"databaseId"+"}", url.PathEscape(parameterValueToString(r.databaseId, "databaseId")), -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 err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, 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 + } + return newErr + } + + return nil +} + +type ApiDeleteInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string +} + +func (r ApiDeleteInstanceRequest) Execute() error { + return r.ApiService.DeleteInstanceExecute(r) +} + +/* +DeleteInstance Delete Instance + +Delete available instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @param instanceId Instance ID + @return ApiDeleteInstanceRequest +*/ +func (a *DefaultAPIService) DeleteInstance(ctx context.Context, projectId string, region string, instanceId string) ApiDeleteInstanceRequest { + return ApiDeleteInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteInstanceExecute(r ApiDeleteInstanceRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteInstance") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -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 err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, 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 == 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 ApiDeleteUserRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + userId string +} + +func (r ApiDeleteUserRequest) Execute() error { + return r.ApiService.DeleteUserExecute(r) +} + +/* +DeleteUser Delete User + +Delete user for an instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @param instanceId Instance ID + @param userId User ID + @return ApiDeleteUserRequest +*/ +func (a *DefaultAPIService) DeleteUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiDeleteUserRequest { + return ApiDeleteUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + userId: userId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteUserExecute(r ApiDeleteUserRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteUser") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -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 err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, 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 + } + return newErr + } + + return nil +} + +type ApiForceDeleteInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string +} + +func (r ApiForceDeleteInstanceRequest) Execute() error { + return r.ApiService.ForceDeleteInstanceExecute(r) +} + +/* +ForceDeleteInstance Force delete instance + +Forces the deletion of an delayed deleted instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @param instanceId Instance ID + @return ApiForceDeleteInstanceRequest +*/ +func (a *DefaultAPIService) ForceDeleteInstance(ctx context.Context, projectId string, region string, instanceId string) ApiForceDeleteInstanceRequest { + return ApiForceDeleteInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) ForceDeleteInstanceExecute(r ApiForceDeleteInstanceRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ForceDeleteInstance") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/force" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -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 err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, 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 == 406 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != 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 ApiGetBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + backupId string +} + +func (r ApiGetBackupRequest) Execute() (*GetBackupResponse, error) { + return r.ApiService.GetBackupExecute(r) +} + +/* +GetBackup Get specific backup + +Get specific available backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @param instanceId Instance ID + @param backupId Backup ID + @return ApiGetBackupRequest +*/ +func (a *DefaultAPIService) GetBackup(ctx context.Context, projectId string, region string, instanceId string, backupId string) ApiGetBackupRequest { + return ApiGetBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + backupId: backupId, + } +} + +// Execute executes the request +// +// @return GetBackupResponse +func (a *DefaultAPIService) GetBackupExecute(r ApiGetBackupRequest) (*GetBackupResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetBackupResponse + ) + + 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}/instances/{instanceId}/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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -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 + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string +} + +func (r ApiGetInstanceRequest) Execute() (*InstanceResponse, error) { + return r.ApiService.GetInstanceExecute(r) +} + +/* +GetInstance Get specific instance + +Get specific available instances + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @param instanceId Instance ID + @return ApiGetInstanceRequest +*/ +func (a *DefaultAPIService) GetInstance(ctx context.Context, projectId string, region string, instanceId string) ApiGetInstanceRequest { + return ApiGetInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return InstanceResponse +func (a *DefaultAPIService) GetInstanceExecute(r ApiGetInstanceRequest) (*InstanceResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetInstance") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -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 + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetUserRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + userId string +} + +func (r ApiGetUserRequest) Execute() (*GetUserResponse, error) { + return r.ApiService.GetUserExecute(r) +} + +/* +GetUser Get User + +Get specific available user for an instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @param instanceId Instance ID + @param userId User ID + @return ApiGetUserRequest +*/ +func (a *DefaultAPIService) GetUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiGetUserRequest { + return ApiGetUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + userId: userId, + } +} + +// Execute executes the request +// +// @return GetUserResponse +func (a *DefaultAPIService) GetUserExecute(r ApiGetUserRequest) (*GetUserResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetUserResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetUser") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -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 + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.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 + instanceId string +} + +func (r ApiListBackupsRequest) Execute() (*ListBackupsResponse, error) { + return r.ApiService.ListBackupsExecute(r) +} + +/* +ListBackups List backups + +List all backups which are available for a specific instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @param instanceId Instance ID + @return ApiListBackupsRequest +*/ +func (a *DefaultAPIService) ListBackups(ctx context.Context, projectId string, region string, instanceId string) ApiListBackupsRequest { + return ApiListBackupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListBackupsResponse +func (a *DefaultAPIService) ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListBackupsResponse + ) + + 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}/instances/{instanceId}/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) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -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 + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListDatabaseParametersRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string +} + +func (r ApiListDatabaseParametersRequest) Execute() (*PostgresDatabaseParameterResponse, error) { + return r.ApiService.ListDatabaseParametersExecute(r) +} + +/* +ListDatabaseParameters List Databases parameter + +List available databases parameter + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @param instanceId Instance ID + @return ApiListDatabaseParametersRequest +*/ +func (a *DefaultAPIService) ListDatabaseParameters(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabaseParametersRequest { + return ApiListDatabaseParametersRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return PostgresDatabaseParameterResponse +func (a *DefaultAPIService) ListDatabaseParametersExecute(r ApiListDatabaseParametersRequest) (*PostgresDatabaseParameterResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PostgresDatabaseParameterResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListDatabaseParameters") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/parameter" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -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 + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListDatabasesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string +} + +func (r ApiListDatabasesRequest) Execute() (*InstanceListDatabasesResponse, error) { + return r.ApiService.ListDatabasesExecute(r) +} + +/* +ListDatabases List Databases + +List available databases for an instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @param instanceId Instance ID + @return ApiListDatabasesRequest +*/ +func (a *DefaultAPIService) ListDatabases(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabasesRequest { + return ApiListDatabasesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return InstanceListDatabasesResponse +func (a *DefaultAPIService) ListDatabasesExecute(r ApiListDatabasesRequest) (*InstanceListDatabasesResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InstanceListDatabasesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListDatabases") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/databases" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -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 + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListFlavorsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string +} + +func (r ApiListFlavorsRequest) Execute() (*ListFlavorsResponse, error) { + return r.ApiService.ListFlavorsExecute(r) +} + +/* +ListFlavors Get Flavors + +Get available flavors for a specific projectID + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @return ApiListFlavorsRequest +*/ +func (a *DefaultAPIService) ListFlavors(ctx context.Context, projectId string, region string) ApiListFlavorsRequest { + return ApiListFlavorsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return ListFlavorsResponse +func (a *DefaultAPIService) ListFlavorsExecute(r ApiListFlavorsRequest) (*ListFlavorsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListFlavorsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListFlavors") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/flavors" + 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{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(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 + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListInstancesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string +} + +func (r ApiListInstancesRequest) Execute() (*ListInstancesResponse, error) { + return r.ApiService.ListInstancesExecute(r) +} + +/* +ListInstances List Instances + +List available instances + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @return ApiListInstancesRequest +*/ +func (a *DefaultAPIService) ListInstances(ctx context.Context, projectId string, region string) ApiListInstancesRequest { + return ApiListInstancesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return ListInstancesResponse +func (a *DefaultAPIService) ListInstancesExecute(r ApiListInstancesRequest) (*ListInstancesResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListInstancesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListInstances") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances" + 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{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(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 + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListMetricsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + metric string + granularity *string + period *string + start *string + end *string +} + +// The granularity in ISO8601 e.g. 5 minutes are 'PT5M'. +func (r ApiListMetricsRequest) Granularity(granularity string) ApiListMetricsRequest { + r.granularity = &granularity + return r +} + +// The period in ISO8601 format e.g. 5 minutes are 'PT5M'. If no period is provided, the standard value of 5 minutes is used. +func (r ApiListMetricsRequest) Period(period string) ApiListMetricsRequest { + r.period = &period + return r +} + +// The start of the timeframe as timestamp in ISO8601 (RFC3339) e.g. '2023-08-28T07:10:52.536Z'. If no start time is provided, current server time as UTC is used. +func (r ApiListMetricsRequest) Start(start string) ApiListMetricsRequest { + r.start = &start + return r +} + +// The end of the timeframe as timestamp in ISO8601 (RFC3339) e.g. '2023-08-28T07:10:52.536Z'. +func (r ApiListMetricsRequest) End(end string) ApiListMetricsRequest { + r.end = &end + return r +} + +func (r ApiListMetricsRequest) Execute() (*InstanceMetricsResponse, error) { + return r.ApiService.ListMetricsExecute(r) +} + +/* +ListMetrics Get Metric + +Returns a metric for an instance. The metric will only be for the master pod if needed. Granularity parameter is always needed. If start and end time is provided, period is not considered in max-connections and disk-use. If you provide start time, you have to provide end time as well and vice versa. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The UUID of the project. + @param region The region which should be addressed + @param instanceId The UUID of the instance. + @param metric The name of the metric. Valid metrics are 'cpu', 'memory', 'max-connections', 'connections' and 'disk-use'. + @return ApiListMetricsRequest +*/ +func (a *DefaultAPIService) ListMetrics(ctx context.Context, projectId string, region string, instanceId string, metric string) ApiListMetricsRequest { + return ApiListMetricsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + metric: metric, + } +} + +// Execute executes the request +// +// @return InstanceMetricsResponse +func (a *DefaultAPIService) ListMetricsExecute(r ApiListMetricsRequest) (*InstanceMetricsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InstanceMetricsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListMetrics") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/metrics/{metric}" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"metric"+"}", url.PathEscape(parameterValueToString(r.metric, "metric")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.granularity == nil { + return localVarReturnValue, reportError("granularity is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "granularity", r.granularity, "form", "") + if r.period != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "period", r.period, "form", "") + } + if r.start != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "start", r.start, "form", "") + } + if r.end != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "end", r.end, "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 == 405 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListStoragesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + flavorId string +} + +func (r ApiListStoragesRequest) Execute() (*ListStoragesResponse, error) { + return r.ApiService.ListStoragesExecute(r) +} + +/* +ListStorages Get Storages + +Get available storages for a specific flavor + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @param flavorId Flavor ID + @return ApiListStoragesRequest +*/ +func (a *DefaultAPIService) ListStorages(ctx context.Context, projectId string, region string, flavorId string) ApiListStoragesRequest { + return ApiListStoragesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + flavorId: flavorId, + } +} + +// Execute executes the request +// +// @return ListStoragesResponse +func (a *DefaultAPIService) ListStoragesExecute(r ApiListStoragesRequest) (*ListStoragesResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListStoragesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListStorages") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/storages/{flavorId}" + 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, "{"+"flavorId"+"}", url.PathEscape(parameterValueToString(r.flavorId, "flavorId")), -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 + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListUsersRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string +} + +func (r ApiListUsersRequest) Execute() (*ListUsersResponse, error) { + return r.ApiService.ListUsersExecute(r) +} + +/* +ListUsers List Users + +List available users for an instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @param instanceId Instance ID + @return ApiListUsersRequest +*/ +func (a *DefaultAPIService) ListUsers(ctx context.Context, projectId string, region string, instanceId string) ApiListUsersRequest { + return ApiListUsersRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListUsersResponse +func (a *DefaultAPIService) ListUsersExecute(r ApiListUsersRequest) (*ListUsersResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListUsersResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListUsers") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -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 + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListVersionsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId *string +} + +// Instance ID +func (r ApiListVersionsRequest) InstanceId(instanceId string) ApiListVersionsRequest { + r.instanceId = &instanceId + return r +} + +func (r ApiListVersionsRequest) Execute() (*ListVersionsResponse, error) { + return r.ApiService.ListVersionsExecute(r) +} + +/* +ListVersions Get Versions + +Get available versions for postgres database + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @return ApiListVersionsRequest +*/ +func (a *DefaultAPIService) ListVersions(ctx context.Context, projectId string, region string) ApiListVersionsRequest { + return ApiListVersionsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return ListVersionsResponse +func (a *DefaultAPIService) ListVersionsExecute(r ApiListVersionsRequest) (*ListVersionsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListVersionsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListVersions") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/versions" + 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 r.instanceId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "instanceId", r.instanceId, "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 + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiPartialUpdateInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + partialUpdateInstancePayload *PartialUpdateInstancePayload +} + +// Body +func (r ApiPartialUpdateInstanceRequest) PartialUpdateInstancePayload(partialUpdateInstancePayload PartialUpdateInstancePayload) ApiPartialUpdateInstanceRequest { + r.partialUpdateInstancePayload = &partialUpdateInstancePayload + return r +} + +func (r ApiPartialUpdateInstanceRequest) Execute() (*PartialUpdateInstanceResponse, error) { + return r.ApiService.PartialUpdateInstanceExecute(r) +} + +/* +PartialUpdateInstance Update Instance + +Update available instance of a postgres database. Supported Versions are 12, 13, 14, 15 -- only upgrades are allowed! + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @param instanceId Instance ID + @return ApiPartialUpdateInstanceRequest +*/ +func (a *DefaultAPIService) PartialUpdateInstance(ctx context.Context, projectId string, region string, instanceId string) ApiPartialUpdateInstanceRequest { + return ApiPartialUpdateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return PartialUpdateInstanceResponse +func (a *DefaultAPIService) PartialUpdateInstanceExecute(r ApiPartialUpdateInstanceRequest) (*PartialUpdateInstanceResponse, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PartialUpdateInstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PartialUpdateInstance") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.partialUpdateInstancePayload == nil { + return localVarReturnValue, reportError("partialUpdateInstancePayload 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.partialUpdateInstancePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiPartialUpdateUserRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + userId string + partialUpdateUserPayload *PartialUpdateUserPayload +} + +// The Request body only required in PUT endpoint. If empty request body is send via patch, then login and createdb roles are removed from user. The field +func (r ApiPartialUpdateUserRequest) PartialUpdateUserPayload(partialUpdateUserPayload PartialUpdateUserPayload) ApiPartialUpdateUserRequest { + r.partialUpdateUserPayload = &partialUpdateUserPayload + return r +} + +func (r ApiPartialUpdateUserRequest) Execute() error { + return r.ApiService.PartialUpdateUserExecute(r) +} + +/* +PartialUpdateUser Update User + +Update user for an instance. Only the roles are updatable. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The ID of the project + @param region The region which should be addressed + @param instanceId The ID of the instance + @param userId The ID of the user in the database + @return ApiPartialUpdateUserRequest +*/ +func (a *DefaultAPIService) PartialUpdateUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiPartialUpdateUserRequest { + return ApiPartialUpdateUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + userId: userId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) PartialUpdateUserExecute(r ApiPartialUpdateUserRequest) error { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PartialUpdateUser") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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.partialUpdateUserPayload + 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 == 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 ApiResetUserRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + userId string +} + +func (r ApiResetUserRequest) Execute() (*ResetUserResponse, error) { + return r.ApiService.ResetUserExecute(r) +} + +/* +ResetUser Reset User + +Reset user password for a postgres instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @param instanceId Instance ID + @param userId user ID + @return ApiResetUserRequest +*/ +func (a *DefaultAPIService) ResetUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiResetUserRequest { + return ApiResetUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + userId: userId, + } +} + +// Execute executes the request +// +// @return ResetUserResponse +func (a *DefaultAPIService) ResetUserExecute(r ApiResetUserRequest) (*ResetUserResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ResetUserResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ResetUser") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}/reset" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -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 == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateBackupScheduleRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + updateBackupSchedulePayload *UpdateBackupSchedulePayload +} + +// Body +func (r ApiUpdateBackupScheduleRequest) UpdateBackupSchedulePayload(updateBackupSchedulePayload UpdateBackupSchedulePayload) ApiUpdateBackupScheduleRequest { + r.updateBackupSchedulePayload = &updateBackupSchedulePayload + return r +} + +func (r ApiUpdateBackupScheduleRequest) Execute() error { + return r.ApiService.UpdateBackupScheduleExecute(r) +} + +/* +UpdateBackupSchedule Update Backup Schedule + +Update backup schedule + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @param instanceId Instance ID + @return ApiUpdateBackupScheduleRequest +*/ +func (a *DefaultAPIService) UpdateBackupSchedule(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateBackupScheduleRequest { + return ApiUpdateBackupScheduleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) UpdateBackupScheduleExecute(r ApiUpdateBackupScheduleRequest) error { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateBackupSchedule") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/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) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateBackupSchedulePayload == nil { + return reportError("updateBackupSchedulePayload 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.updateBackupSchedulePayload + 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 + } + return newErr + } + + return nil +} + +type ApiUpdateInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + updateInstancePayload *UpdateInstancePayload +} + +// Body +func (r ApiUpdateInstanceRequest) UpdateInstancePayload(updateInstancePayload UpdateInstancePayload) ApiUpdateInstanceRequest { + r.updateInstancePayload = &updateInstancePayload + return r +} + +func (r ApiUpdateInstanceRequest) Execute() (*PartialUpdateInstanceResponse, error) { + return r.ApiService.UpdateInstanceExecute(r) +} + +/* +UpdateInstance Update Instance + +Update available instance of a postgres database. Supported Versions are 12, 13, 14, 15 -- only upgrades are allowed! + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param region The region which should be addressed + @param instanceId Instance ID + @return ApiUpdateInstanceRequest +*/ +func (a *DefaultAPIService) UpdateInstance(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceRequest { + return ApiUpdateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return PartialUpdateInstanceResponse +func (a *DefaultAPIService) UpdateInstanceExecute(r ApiUpdateInstanceRequest) (*PartialUpdateInstanceResponse, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PartialUpdateInstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateInstance") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateInstancePayload == nil { + return localVarReturnValue, reportError("updateInstancePayload 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.updateInstancePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateUserRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + userId string + updateUserPayload *UpdateUserPayload +} + +// The Request body only required in PUT endpoint. If empty request body is send via patch, then login and createdb roles are removed from user. The field +func (r ApiUpdateUserRequest) UpdateUserPayload(updateUserPayload UpdateUserPayload) ApiUpdateUserRequest { + r.updateUserPayload = &updateUserPayload + return r +} + +func (r ApiUpdateUserRequest) Execute() error { + return r.ApiService.UpdateUserExecute(r) +} + +/* +UpdateUser Update User + +Update user for an instance. Only the roles are updatable. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The ID of the project + @param region The region which should be addressed + @param instanceId The ID of the instance + @param userId The ID of the user in the database + @return ApiUpdateUserRequest +*/ +func (a *DefaultAPIService) UpdateUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiUpdateUserRequest { + return ApiUpdateUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + userId: userId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) UpdateUserExecute(r ApiUpdateUserRequest) error { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateUser") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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.updateUserPayload + 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 == 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 +} diff --git a/services/postgresflex/v2api/api_default_mock.go b/services/postgresflex/v2api/api_default_mock.go new file mode 100644 index 000000000..97b993ec6 --- /dev/null +++ b/services/postgresflex/v2api/api_default_mock.go @@ -0,0 +1,593 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// 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 { + // CloneInstanceExecuteMock can be populated to implement the behavior of the CloneInstanceExecute function of this mock + CloneInstanceExecuteMock *func(r ApiCloneInstanceRequest) (*CloneInstanceResponse, error) + // CreateDatabaseExecuteMock can be populated to implement the behavior of the CreateDatabaseExecute function of this mock + CreateDatabaseExecuteMock *func(r ApiCreateDatabaseRequest) (*InstanceCreateDatabaseResponse, error) + // CreateInstanceExecuteMock can be populated to implement the behavior of the CreateInstanceExecute function of this mock + CreateInstanceExecuteMock *func(r ApiCreateInstanceRequest) (*CreateInstanceResponse, error) + // CreateUserExecuteMock can be populated to implement the behavior of the CreateUserExecute function of this mock + CreateUserExecuteMock *func(r ApiCreateUserRequest) (*CreateUserResponse, error) + // DeleteDatabaseExecuteMock can be populated to implement the behavior of the DeleteDatabaseExecute function of this mock + DeleteDatabaseExecuteMock *func(r ApiDeleteDatabaseRequest) error + // DeleteInstanceExecuteMock can be populated to implement the behavior of the DeleteInstanceExecute function of this mock + DeleteInstanceExecuteMock *func(r ApiDeleteInstanceRequest) error + // DeleteUserExecuteMock can be populated to implement the behavior of the DeleteUserExecute function of this mock + DeleteUserExecuteMock *func(r ApiDeleteUserRequest) error + // ForceDeleteInstanceExecuteMock can be populated to implement the behavior of the ForceDeleteInstanceExecute function of this mock + ForceDeleteInstanceExecuteMock *func(r ApiForceDeleteInstanceRequest) error + // GetBackupExecuteMock can be populated to implement the behavior of the GetBackupExecute function of this mock + GetBackupExecuteMock *func(r ApiGetBackupRequest) (*GetBackupResponse, error) + // GetInstanceExecuteMock can be populated to implement the behavior of the GetInstanceExecute function of this mock + GetInstanceExecuteMock *func(r ApiGetInstanceRequest) (*InstanceResponse, error) + // GetUserExecuteMock can be populated to implement the behavior of the GetUserExecute function of this mock + GetUserExecuteMock *func(r ApiGetUserRequest) (*GetUserResponse, error) + // ListBackupsExecuteMock can be populated to implement the behavior of the ListBackupsExecute function of this mock + ListBackupsExecuteMock *func(r ApiListBackupsRequest) (*ListBackupsResponse, error) + // ListDatabaseParametersExecuteMock can be populated to implement the behavior of the ListDatabaseParametersExecute function of this mock + ListDatabaseParametersExecuteMock *func(r ApiListDatabaseParametersRequest) (*PostgresDatabaseParameterResponse, error) + // ListDatabasesExecuteMock can be populated to implement the behavior of the ListDatabasesExecute function of this mock + ListDatabasesExecuteMock *func(r ApiListDatabasesRequest) (*InstanceListDatabasesResponse, error) + // ListFlavorsExecuteMock can be populated to implement the behavior of the ListFlavorsExecute function of this mock + ListFlavorsExecuteMock *func(r ApiListFlavorsRequest) (*ListFlavorsResponse, error) + // ListInstancesExecuteMock can be populated to implement the behavior of the ListInstancesExecute function of this mock + ListInstancesExecuteMock *func(r ApiListInstancesRequest) (*ListInstancesResponse, error) + // ListMetricsExecuteMock can be populated to implement the behavior of the ListMetricsExecute function of this mock + ListMetricsExecuteMock *func(r ApiListMetricsRequest) (*InstanceMetricsResponse, error) + // ListStoragesExecuteMock can be populated to implement the behavior of the ListStoragesExecute function of this mock + ListStoragesExecuteMock *func(r ApiListStoragesRequest) (*ListStoragesResponse, error) + // ListUsersExecuteMock can be populated to implement the behavior of the ListUsersExecute function of this mock + ListUsersExecuteMock *func(r ApiListUsersRequest) (*ListUsersResponse, error) + // ListVersionsExecuteMock can be populated to implement the behavior of the ListVersionsExecute function of this mock + ListVersionsExecuteMock *func(r ApiListVersionsRequest) (*ListVersionsResponse, error) + // PartialUpdateInstanceExecuteMock can be populated to implement the behavior of the PartialUpdateInstanceExecute function of this mock + PartialUpdateInstanceExecuteMock *func(r ApiPartialUpdateInstanceRequest) (*PartialUpdateInstanceResponse, error) + // PartialUpdateUserExecuteMock can be populated to implement the behavior of the PartialUpdateUserExecute function of this mock + PartialUpdateUserExecuteMock *func(r ApiPartialUpdateUserRequest) error + // ResetUserExecuteMock can be populated to implement the behavior of the ResetUserExecute function of this mock + ResetUserExecuteMock *func(r ApiResetUserRequest) (*ResetUserResponse, error) + // UpdateBackupScheduleExecuteMock can be populated to implement the behavior of the UpdateBackupScheduleExecute function of this mock + UpdateBackupScheduleExecuteMock *func(r ApiUpdateBackupScheduleRequest) error + // UpdateInstanceExecuteMock can be populated to implement the behavior of the UpdateInstanceExecute function of this mock + UpdateInstanceExecuteMock *func(r ApiUpdateInstanceRequest) (*PartialUpdateInstanceResponse, error) + // UpdateUserExecuteMock can be populated to implement the behavior of the UpdateUserExecute function of this mock + UpdateUserExecuteMock *func(r ApiUpdateUserRequest) error +} + +func (a DefaultAPIServiceMock) CloneInstance(ctx context.Context, projectId string, region string, instanceId string) ApiCloneInstanceRequest { + return ApiCloneInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// CloneInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CloneInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CloneInstanceExecute(r ApiCloneInstanceRequest) (*CloneInstanceResponse, error) { + if a.CloneInstanceExecuteMock == nil { + var localVarReturnValue *CloneInstanceResponse + return localVarReturnValue, nil + } + + return (*a.CloneInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateDatabase(ctx context.Context, projectId string, region string, instanceId string) ApiCreateDatabaseRequest { + return ApiCreateDatabaseRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// CreateDatabaseExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateDatabaseExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateDatabaseExecute(r ApiCreateDatabaseRequest) (*InstanceCreateDatabaseResponse, error) { + if a.CreateDatabaseExecuteMock == nil { + var localVarReturnValue *InstanceCreateDatabaseResponse + return localVarReturnValue, nil + } + + return (*a.CreateDatabaseExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateInstance(ctx context.Context, projectId string, region string) ApiCreateInstanceRequest { + return ApiCreateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// CreateInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateInstanceExecute(r ApiCreateInstanceRequest) (*CreateInstanceResponse, error) { + if a.CreateInstanceExecuteMock == nil { + var localVarReturnValue *CreateInstanceResponse + return localVarReturnValue, nil + } + + return (*a.CreateInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateUser(ctx context.Context, projectId string, region string, instanceId string) ApiCreateUserRequest { + return ApiCreateUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// CreateUserExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateUserExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateUserExecute(r ApiCreateUserRequest) (*CreateUserResponse, error) { + if a.CreateUserExecuteMock == nil { + var localVarReturnValue *CreateUserResponse + return localVarReturnValue, nil + } + + return (*a.CreateUserExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteDatabase(ctx context.Context, projectId string, region string, instanceId string, databaseId string) ApiDeleteDatabaseRequest { + return ApiDeleteDatabaseRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + databaseId: databaseId, + } +} + +// DeleteDatabaseExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteDatabaseExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteDatabaseExecute(r ApiDeleteDatabaseRequest) error { + if a.DeleteDatabaseExecuteMock == nil { + return nil + } + + return (*a.DeleteDatabaseExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteInstance(ctx context.Context, projectId string, region string, instanceId string) ApiDeleteInstanceRequest { + return ApiDeleteInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// DeleteInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteInstanceExecute(r ApiDeleteInstanceRequest) error { + if a.DeleteInstanceExecuteMock == nil { + return nil + } + + return (*a.DeleteInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiDeleteUserRequest { + return ApiDeleteUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + userId: userId, + } +} + +// DeleteUserExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteUserExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteUserExecute(r ApiDeleteUserRequest) error { + if a.DeleteUserExecuteMock == nil { + return nil + } + + return (*a.DeleteUserExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ForceDeleteInstance(ctx context.Context, projectId string, region string, instanceId string) ApiForceDeleteInstanceRequest { + return ApiForceDeleteInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// ForceDeleteInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ForceDeleteInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ForceDeleteInstanceExecute(r ApiForceDeleteInstanceRequest) error { + if a.ForceDeleteInstanceExecuteMock == nil { + return nil + } + + return (*a.ForceDeleteInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetBackup(ctx context.Context, projectId string, region string, instanceId string, backupId string) ApiGetBackupRequest { + return ApiGetBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + 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) (*GetBackupResponse, error) { + if a.GetBackupExecuteMock == nil { + var localVarReturnValue *GetBackupResponse + return localVarReturnValue, nil + } + + return (*a.GetBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetInstance(ctx context.Context, projectId string, region string, instanceId string) ApiGetInstanceRequest { + return ApiGetInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// GetInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetInstanceExecute(r ApiGetInstanceRequest) (*InstanceResponse, error) { + if a.GetInstanceExecuteMock == nil { + var localVarReturnValue *InstanceResponse + return localVarReturnValue, nil + } + + return (*a.GetInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiGetUserRequest { + return ApiGetUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + userId: userId, + } +} + +// GetUserExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetUserExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetUserExecute(r ApiGetUserRequest) (*GetUserResponse, error) { + if a.GetUserExecuteMock == nil { + var localVarReturnValue *GetUserResponse + return localVarReturnValue, nil + } + + return (*a.GetUserExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListBackups(ctx context.Context, projectId string, region string, instanceId string) ApiListBackupsRequest { + return ApiListBackupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// 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) (*ListBackupsResponse, error) { + if a.ListBackupsExecuteMock == nil { + var localVarReturnValue *ListBackupsResponse + return localVarReturnValue, nil + } + + return (*a.ListBackupsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListDatabaseParameters(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabaseParametersRequest { + return ApiListDatabaseParametersRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// ListDatabaseParametersExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListDatabaseParametersExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListDatabaseParametersExecute(r ApiListDatabaseParametersRequest) (*PostgresDatabaseParameterResponse, error) { + if a.ListDatabaseParametersExecuteMock == nil { + var localVarReturnValue *PostgresDatabaseParameterResponse + return localVarReturnValue, nil + } + + return (*a.ListDatabaseParametersExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListDatabases(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabasesRequest { + return ApiListDatabasesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// ListDatabasesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListDatabasesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListDatabasesExecute(r ApiListDatabasesRequest) (*InstanceListDatabasesResponse, error) { + if a.ListDatabasesExecuteMock == nil { + var localVarReturnValue *InstanceListDatabasesResponse + return localVarReturnValue, nil + } + + return (*a.ListDatabasesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListFlavors(ctx context.Context, projectId string, region string) ApiListFlavorsRequest { + return ApiListFlavorsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// ListFlavorsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListFlavorsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListFlavorsExecute(r ApiListFlavorsRequest) (*ListFlavorsResponse, error) { + if a.ListFlavorsExecuteMock == nil { + var localVarReturnValue *ListFlavorsResponse + return localVarReturnValue, nil + } + + return (*a.ListFlavorsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListInstances(ctx context.Context, projectId string, region string) ApiListInstancesRequest { + return ApiListInstancesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// ListInstancesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListInstancesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListInstancesExecute(r ApiListInstancesRequest) (*ListInstancesResponse, error) { + if a.ListInstancesExecuteMock == nil { + var localVarReturnValue *ListInstancesResponse + return localVarReturnValue, nil + } + + return (*a.ListInstancesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListMetrics(ctx context.Context, projectId string, region string, instanceId string, metric string) ApiListMetricsRequest { + return ApiListMetricsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + metric: metric, + } +} + +// ListMetricsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListMetricsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListMetricsExecute(r ApiListMetricsRequest) (*InstanceMetricsResponse, error) { + if a.ListMetricsExecuteMock == nil { + var localVarReturnValue *InstanceMetricsResponse + return localVarReturnValue, nil + } + + return (*a.ListMetricsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListStorages(ctx context.Context, projectId string, region string, flavorId string) ApiListStoragesRequest { + return ApiListStoragesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + flavorId: flavorId, + } +} + +// ListStoragesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListStoragesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListStoragesExecute(r ApiListStoragesRequest) (*ListStoragesResponse, error) { + if a.ListStoragesExecuteMock == nil { + var localVarReturnValue *ListStoragesResponse + return localVarReturnValue, nil + } + + return (*a.ListStoragesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListUsers(ctx context.Context, projectId string, region string, instanceId string) ApiListUsersRequest { + return ApiListUsersRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// ListUsersExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListUsersExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListUsersExecute(r ApiListUsersRequest) (*ListUsersResponse, error) { + if a.ListUsersExecuteMock == nil { + var localVarReturnValue *ListUsersResponse + return localVarReturnValue, nil + } + + return (*a.ListUsersExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListVersions(ctx context.Context, projectId string, region string) ApiListVersionsRequest { + return ApiListVersionsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// ListVersionsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListVersionsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListVersionsExecute(r ApiListVersionsRequest) (*ListVersionsResponse, error) { + if a.ListVersionsExecuteMock == nil { + var localVarReturnValue *ListVersionsResponse + return localVarReturnValue, nil + } + + return (*a.ListVersionsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) PartialUpdateInstance(ctx context.Context, projectId string, region string, instanceId string) ApiPartialUpdateInstanceRequest { + return ApiPartialUpdateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// PartialUpdateInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PartialUpdateInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) PartialUpdateInstanceExecute(r ApiPartialUpdateInstanceRequest) (*PartialUpdateInstanceResponse, error) { + if a.PartialUpdateInstanceExecuteMock == nil { + var localVarReturnValue *PartialUpdateInstanceResponse + return localVarReturnValue, nil + } + + return (*a.PartialUpdateInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) PartialUpdateUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiPartialUpdateUserRequest { + return ApiPartialUpdateUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + userId: userId, + } +} + +// PartialUpdateUserExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PartialUpdateUserExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) PartialUpdateUserExecute(r ApiPartialUpdateUserRequest) error { + if a.PartialUpdateUserExecuteMock == nil { + return nil + } + + return (*a.PartialUpdateUserExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ResetUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiResetUserRequest { + return ApiResetUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + userId: userId, + } +} + +// ResetUserExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ResetUserExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ResetUserExecute(r ApiResetUserRequest) (*ResetUserResponse, error) { + if a.ResetUserExecuteMock == nil { + var localVarReturnValue *ResetUserResponse + return localVarReturnValue, nil + } + + return (*a.ResetUserExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateBackupSchedule(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateBackupScheduleRequest { + return ApiUpdateBackupScheduleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// UpdateBackupScheduleExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateBackupScheduleExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateBackupScheduleExecute(r ApiUpdateBackupScheduleRequest) error { + if a.UpdateBackupScheduleExecuteMock == nil { + return nil + } + + return (*a.UpdateBackupScheduleExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateInstance(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceRequest { + return ApiUpdateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// UpdateInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateInstanceExecute(r ApiUpdateInstanceRequest) (*PartialUpdateInstanceResponse, error) { + if a.UpdateInstanceExecuteMock == nil { + var localVarReturnValue *PartialUpdateInstanceResponse + return localVarReturnValue, nil + } + + return (*a.UpdateInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiUpdateUserRequest { + return ApiUpdateUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + userId: userId, + } +} + +// UpdateUserExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateUserExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateUserExecute(r ApiUpdateUserRequest) error { + if a.UpdateUserExecuteMock == nil { + return nil + } + + return (*a.UpdateUserExecuteMock)(r) +} diff --git a/services/postgresflex/v2api/client.go b/services/postgresflex/v2api/client.go new file mode 100644 index 000000000..be715b151 --- /dev/null +++ b/services/postgresflex/v2api/client.go @@ -0,0 +1,659 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// 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 PostgreSQL Flex API API v2.0.0 +// 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/postgresflex/v2api/configuration.go b/services/postgresflex/v2api/configuration.go new file mode 100644 index 000000000..e5a982b66 --- /dev/null +++ b/services/postgresflex/v2api/configuration.go @@ -0,0 +1,38 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// 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/postgresflex", + Debug: false, + Servers: config.ServerConfigurations{ + { + URL: "https://postgres-flex-service.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/postgresflex/v2api/model_acl.go b/services/postgresflex/v2api/model_acl.go new file mode 100644 index 000000000..d2870e26b --- /dev/null +++ b/services/postgresflex/v2api/model_acl.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the ACL type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ACL{} + +// ACL struct for ACL +type ACL struct { + Items []string `json:"items,omitempty"` +} + +// NewACL instantiates a new ACL object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewACL() *ACL { + this := ACL{} + return &this +} + +// NewACLWithDefaults instantiates a new ACL object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewACLWithDefaults() *ACL { + this := ACL{} + return &this +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *ACL) GetItems() []string { + if o == nil || IsNil(o.Items) { + var ret []string + return ret + } + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ACL) GetItemsOk() ([]string, bool) { + if o == nil || IsNil(o.Items) { + return nil, false + } + return o.Items, true +} + +// HasItems returns a boolean if a field has been set. +func (o *ACL) HasItems() bool { + if o != nil && !IsNil(o.Items) { + return true + } + + return false +} + +// SetItems gets a reference to the given []string and assigns it to the Items field. +func (o *ACL) SetItems(v []string) { + o.Items = v +} + +func (o ACL) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ACL) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Items) { + toSerialize["items"] = o.Items + } + return toSerialize, nil +} + +type NullableACL struct { + value *ACL + isSet bool +} + +func (v NullableACL) Get() *ACL { + return v.value +} + +func (v *NullableACL) Set(val *ACL) { + v.value = val + v.isSet = true +} + +func (v NullableACL) IsSet() bool { + return v.isSet +} + +func (v *NullableACL) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableACL(val *ACL) *NullableACL { + return &NullableACL{value: val, isSet: true} +} + +func (v NullableACL) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableACL) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_api_configuration.go b/services/postgresflex/v2api/model_api_configuration.go new file mode 100644 index 000000000..84d71043d --- /dev/null +++ b/services/postgresflex/v2api/model_api_configuration.go @@ -0,0 +1,161 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the ApiConfiguration type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApiConfiguration{} + +// ApiConfiguration struct for ApiConfiguration +type ApiConfiguration struct { + Name *string `json:"name,omitempty"` + Setting *string `json:"setting,omitempty"` +} + +// NewApiConfiguration instantiates a new ApiConfiguration object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewApiConfiguration() *ApiConfiguration { + this := ApiConfiguration{} + return &this +} + +// NewApiConfigurationWithDefaults instantiates a new ApiConfiguration object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewApiConfigurationWithDefaults() *ApiConfiguration { + this := ApiConfiguration{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *ApiConfiguration) 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 *ApiConfiguration) 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 *ApiConfiguration) 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 *ApiConfiguration) SetName(v string) { + o.Name = &v +} + +// GetSetting returns the Setting field value if set, zero value otherwise. +func (o *ApiConfiguration) GetSetting() string { + if o == nil || IsNil(o.Setting) { + var ret string + return ret + } + return *o.Setting +} + +// GetSettingOk returns a tuple with the Setting field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApiConfiguration) GetSettingOk() (*string, bool) { + if o == nil || IsNil(o.Setting) { + return nil, false + } + return o.Setting, true +} + +// HasSetting returns a boolean if a field has been set. +func (o *ApiConfiguration) HasSetting() bool { + if o != nil && !IsNil(o.Setting) { + return true + } + + return false +} + +// SetSetting gets a reference to the given string and assigns it to the Setting field. +func (o *ApiConfiguration) SetSetting(v string) { + o.Setting = &v +} + +func (o ApiConfiguration) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApiConfiguration) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Setting) { + toSerialize["setting"] = o.Setting + } + return toSerialize, nil +} + +type NullableApiConfiguration struct { + value *ApiConfiguration + isSet bool +} + +func (v NullableApiConfiguration) Get() *ApiConfiguration { + return v.value +} + +func (v *NullableApiConfiguration) Set(val *ApiConfiguration) { + v.value = val + v.isSet = true +} + +func (v NullableApiConfiguration) IsSet() bool { + return v.isSet +} + +func (v *NullableApiConfiguration) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApiConfiguration(val *ApiConfiguration) *NullableApiConfiguration { + return &NullableApiConfiguration{value: val, isSet: true} +} + +func (v NullableApiConfiguration) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApiConfiguration) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_api_extension_config_load_response.go b/services/postgresflex/v2api/model_api_extension_config_load_response.go new file mode 100644 index 000000000..9b390c584 --- /dev/null +++ b/services/postgresflex/v2api/model_api_extension_config_load_response.go @@ -0,0 +1,126 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the ApiExtensionConfigLoadResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApiExtensionConfigLoadResponse{} + +// ApiExtensionConfigLoadResponse struct for ApiExtensionConfigLoadResponse +type ApiExtensionConfigLoadResponse struct { + // Returns marshalled JSON of the new configuration of whatever extension is called + Configuration []ApiConfiguration `json:"configuration,omitempty"` +} + +// NewApiExtensionConfigLoadResponse instantiates a new ApiExtensionConfigLoadResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewApiExtensionConfigLoadResponse() *ApiExtensionConfigLoadResponse { + this := ApiExtensionConfigLoadResponse{} + return &this +} + +// NewApiExtensionConfigLoadResponseWithDefaults instantiates a new ApiExtensionConfigLoadResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewApiExtensionConfigLoadResponseWithDefaults() *ApiExtensionConfigLoadResponse { + this := ApiExtensionConfigLoadResponse{} + return &this +} + +// GetConfiguration returns the Configuration field value if set, zero value otherwise. +func (o *ApiExtensionConfigLoadResponse) GetConfiguration() []ApiConfiguration { + if o == nil || IsNil(o.Configuration) { + var ret []ApiConfiguration + return ret + } + return o.Configuration +} + +// GetConfigurationOk returns a tuple with the Configuration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApiExtensionConfigLoadResponse) GetConfigurationOk() ([]ApiConfiguration, bool) { + if o == nil || IsNil(o.Configuration) { + return nil, false + } + return o.Configuration, true +} + +// HasConfiguration returns a boolean if a field has been set. +func (o *ApiExtensionConfigLoadResponse) HasConfiguration() bool { + if o != nil && !IsNil(o.Configuration) { + return true + } + + return false +} + +// SetConfiguration gets a reference to the given []ApiConfiguration and assigns it to the Configuration field. +func (o *ApiExtensionConfigLoadResponse) SetConfiguration(v []ApiConfiguration) { + o.Configuration = v +} + +func (o ApiExtensionConfigLoadResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApiExtensionConfigLoadResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Configuration) { + toSerialize["configuration"] = o.Configuration + } + return toSerialize, nil +} + +type NullableApiExtensionConfigLoadResponse struct { + value *ApiExtensionConfigLoadResponse + isSet bool +} + +func (v NullableApiExtensionConfigLoadResponse) Get() *ApiExtensionConfigLoadResponse { + return v.value +} + +func (v *NullableApiExtensionConfigLoadResponse) Set(val *ApiExtensionConfigLoadResponse) { + v.value = val + v.isSet = true +} + +func (v NullableApiExtensionConfigLoadResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableApiExtensionConfigLoadResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApiExtensionConfigLoadResponse(val *ApiExtensionConfigLoadResponse) *NullableApiExtensionConfigLoadResponse { + return &NullableApiExtensionConfigLoadResponse{value: val, isSet: true} +} + +func (v NullableApiExtensionConfigLoadResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApiExtensionConfigLoadResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_api_extension_configure_response.go b/services/postgresflex/v2api/model_api_extension_configure_response.go new file mode 100644 index 000000000..58d77b7c6 --- /dev/null +++ b/services/postgresflex/v2api/model_api_extension_configure_response.go @@ -0,0 +1,126 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the ApiExtensionConfigureResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApiExtensionConfigureResponse{} + +// ApiExtensionConfigureResponse struct for ApiExtensionConfigureResponse +type ApiExtensionConfigureResponse struct { + // Returns marshalled JSON of the new configuration of whatever extension is called + Configuration []ApiConfiguration `json:"configuration,omitempty"` +} + +// NewApiExtensionConfigureResponse instantiates a new ApiExtensionConfigureResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewApiExtensionConfigureResponse() *ApiExtensionConfigureResponse { + this := ApiExtensionConfigureResponse{} + return &this +} + +// NewApiExtensionConfigureResponseWithDefaults instantiates a new ApiExtensionConfigureResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewApiExtensionConfigureResponseWithDefaults() *ApiExtensionConfigureResponse { + this := ApiExtensionConfigureResponse{} + return &this +} + +// GetConfiguration returns the Configuration field value if set, zero value otherwise. +func (o *ApiExtensionConfigureResponse) GetConfiguration() []ApiConfiguration { + if o == nil || IsNil(o.Configuration) { + var ret []ApiConfiguration + return ret + } + return o.Configuration +} + +// GetConfigurationOk returns a tuple with the Configuration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApiExtensionConfigureResponse) GetConfigurationOk() ([]ApiConfiguration, bool) { + if o == nil || IsNil(o.Configuration) { + return nil, false + } + return o.Configuration, true +} + +// HasConfiguration returns a boolean if a field has been set. +func (o *ApiExtensionConfigureResponse) HasConfiguration() bool { + if o != nil && !IsNil(o.Configuration) { + return true + } + + return false +} + +// SetConfiguration gets a reference to the given []ApiConfiguration and assigns it to the Configuration field. +func (o *ApiExtensionConfigureResponse) SetConfiguration(v []ApiConfiguration) { + o.Configuration = v +} + +func (o ApiExtensionConfigureResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApiExtensionConfigureResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Configuration) { + toSerialize["configuration"] = o.Configuration + } + return toSerialize, nil +} + +type NullableApiExtensionConfigureResponse struct { + value *ApiExtensionConfigureResponse + isSet bool +} + +func (v NullableApiExtensionConfigureResponse) Get() *ApiExtensionConfigureResponse { + return v.value +} + +func (v *NullableApiExtensionConfigureResponse) Set(val *ApiExtensionConfigureResponse) { + v.value = val + v.isSet = true +} + +func (v NullableApiExtensionConfigureResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableApiExtensionConfigureResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApiExtensionConfigureResponse(val *ApiExtensionConfigureResponse) *NullableApiExtensionConfigureResponse { + return &NullableApiExtensionConfigureResponse{value: val, isSet: true} +} + +func (v NullableApiExtensionConfigureResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApiExtensionConfigureResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_api_extension_delete_response.go b/services/postgresflex/v2api/model_api_extension_delete_response.go new file mode 100644 index 000000000..36436e704 --- /dev/null +++ b/services/postgresflex/v2api/model_api_extension_delete_response.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the ApiExtensionDeleteResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApiExtensionDeleteResponse{} + +// ApiExtensionDeleteResponse struct for ApiExtensionDeleteResponse +type ApiExtensionDeleteResponse struct { + IsSucceded *bool `json:"isSucceded,omitempty"` +} + +// NewApiExtensionDeleteResponse instantiates a new ApiExtensionDeleteResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewApiExtensionDeleteResponse() *ApiExtensionDeleteResponse { + this := ApiExtensionDeleteResponse{} + return &this +} + +// NewApiExtensionDeleteResponseWithDefaults instantiates a new ApiExtensionDeleteResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewApiExtensionDeleteResponseWithDefaults() *ApiExtensionDeleteResponse { + this := ApiExtensionDeleteResponse{} + return &this +} + +// GetIsSucceded returns the IsSucceded field value if set, zero value otherwise. +func (o *ApiExtensionDeleteResponse) GetIsSucceded() bool { + if o == nil || IsNil(o.IsSucceded) { + var ret bool + return ret + } + return *o.IsSucceded +} + +// GetIsSuccededOk returns a tuple with the IsSucceded field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApiExtensionDeleteResponse) GetIsSuccededOk() (*bool, bool) { + if o == nil || IsNil(o.IsSucceded) { + return nil, false + } + return o.IsSucceded, true +} + +// HasIsSucceded returns a boolean if a field has been set. +func (o *ApiExtensionDeleteResponse) HasIsSucceded() bool { + if o != nil && !IsNil(o.IsSucceded) { + return true + } + + return false +} + +// SetIsSucceded gets a reference to the given bool and assigns it to the IsSucceded field. +func (o *ApiExtensionDeleteResponse) SetIsSucceded(v bool) { + o.IsSucceded = &v +} + +func (o ApiExtensionDeleteResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApiExtensionDeleteResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.IsSucceded) { + toSerialize["isSucceded"] = o.IsSucceded + } + return toSerialize, nil +} + +type NullableApiExtensionDeleteResponse struct { + value *ApiExtensionDeleteResponse + isSet bool +} + +func (v NullableApiExtensionDeleteResponse) Get() *ApiExtensionDeleteResponse { + return v.value +} + +func (v *NullableApiExtensionDeleteResponse) Set(val *ApiExtensionDeleteResponse) { + v.value = val + v.isSet = true +} + +func (v NullableApiExtensionDeleteResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableApiExtensionDeleteResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApiExtensionDeleteResponse(val *ApiExtensionDeleteResponse) *NullableApiExtensionDeleteResponse { + return &NullableApiExtensionDeleteResponse{value: val, isSet: true} +} + +func (v NullableApiExtensionDeleteResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApiExtensionDeleteResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_api_extension_list.go b/services/postgresflex/v2api/model_api_extension_list.go new file mode 100644 index 000000000..c7e1f2a76 --- /dev/null +++ b/services/postgresflex/v2api/model_api_extension_list.go @@ -0,0 +1,197 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the ApiExtensionList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApiExtensionList{} + +// ApiExtensionList struct for ApiExtensionList +type ApiExtensionList struct { + ID *int64 `json:"ID,omitempty"` + Description *string `json:"description,omitempty"` + Name *string `json:"name,omitempty"` +} + +// NewApiExtensionList instantiates a new ApiExtensionList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewApiExtensionList() *ApiExtensionList { + this := ApiExtensionList{} + return &this +} + +// NewApiExtensionListWithDefaults instantiates a new ApiExtensionList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewApiExtensionListWithDefaults() *ApiExtensionList { + this := ApiExtensionList{} + return &this +} + +// GetID returns the ID field value if set, zero value otherwise. +func (o *ApiExtensionList) GetID() int64 { + if o == nil || IsNil(o.ID) { + var ret int64 + 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 *ApiExtensionList) GetIDOk() (*int64, 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 *ApiExtensionList) HasID() bool { + if o != nil && !IsNil(o.ID) { + return true + } + + return false +} + +// SetID gets a reference to the given int64 and assigns it to the ID field. +func (o *ApiExtensionList) SetID(v int64) { + o.ID = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ApiExtensionList) 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 *ApiExtensionList) 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 *ApiExtensionList) 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 *ApiExtensionList) SetDescription(v string) { + o.Description = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *ApiExtensionList) 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 *ApiExtensionList) 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 *ApiExtensionList) 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 *ApiExtensionList) SetName(v string) { + o.Name = &v +} + +func (o ApiExtensionList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApiExtensionList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ID) { + toSerialize["ID"] = o.ID + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + return toSerialize, nil +} + +type NullableApiExtensionList struct { + value *ApiExtensionList + isSet bool +} + +func (v NullableApiExtensionList) Get() *ApiExtensionList { + return v.value +} + +func (v *NullableApiExtensionList) Set(val *ApiExtensionList) { + v.value = val + v.isSet = true +} + +func (v NullableApiExtensionList) IsSet() bool { + return v.isSet +} + +func (v *NullableApiExtensionList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApiExtensionList(val *ApiExtensionList) *NullableApiExtensionList { + return &NullableApiExtensionList{value: val, isSet: true} +} + +func (v NullableApiExtensionList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApiExtensionList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_api_extension_load_response.go b/services/postgresflex/v2api/model_api_extension_load_response.go new file mode 100644 index 000000000..49ac81fb1 --- /dev/null +++ b/services/postgresflex/v2api/model_api_extension_load_response.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the ApiExtensionLoadResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApiExtensionLoadResponse{} + +// ApiExtensionLoadResponse struct for ApiExtensionLoadResponse +type ApiExtensionLoadResponse struct { + Extension *ApiExtensionList `json:"extension,omitempty"` +} + +// NewApiExtensionLoadResponse instantiates a new ApiExtensionLoadResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewApiExtensionLoadResponse() *ApiExtensionLoadResponse { + this := ApiExtensionLoadResponse{} + return &this +} + +// NewApiExtensionLoadResponseWithDefaults instantiates a new ApiExtensionLoadResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewApiExtensionLoadResponseWithDefaults() *ApiExtensionLoadResponse { + this := ApiExtensionLoadResponse{} + return &this +} + +// GetExtension returns the Extension field value if set, zero value otherwise. +func (o *ApiExtensionLoadResponse) GetExtension() ApiExtensionList { + if o == nil || IsNil(o.Extension) { + var ret ApiExtensionList + return ret + } + return *o.Extension +} + +// GetExtensionOk returns a tuple with the Extension field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApiExtensionLoadResponse) GetExtensionOk() (*ApiExtensionList, bool) { + if o == nil || IsNil(o.Extension) { + return nil, false + } + return o.Extension, true +} + +// HasExtension returns a boolean if a field has been set. +func (o *ApiExtensionLoadResponse) HasExtension() bool { + if o != nil && !IsNil(o.Extension) { + return true + } + + return false +} + +// SetExtension gets a reference to the given ApiExtensionList and assigns it to the Extension field. +func (o *ApiExtensionLoadResponse) SetExtension(v ApiExtensionList) { + o.Extension = &v +} + +func (o ApiExtensionLoadResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApiExtensionLoadResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Extension) { + toSerialize["extension"] = o.Extension + } + return toSerialize, nil +} + +type NullableApiExtensionLoadResponse struct { + value *ApiExtensionLoadResponse + isSet bool +} + +func (v NullableApiExtensionLoadResponse) Get() *ApiExtensionLoadResponse { + return v.value +} + +func (v *NullableApiExtensionLoadResponse) Set(val *ApiExtensionLoadResponse) { + v.value = val + v.isSet = true +} + +func (v NullableApiExtensionLoadResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableApiExtensionLoadResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApiExtensionLoadResponse(val *ApiExtensionLoadResponse) *NullableApiExtensionLoadResponse { + return &NullableApiExtensionLoadResponse{value: val, isSet: true} +} + +func (v NullableApiExtensionLoadResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApiExtensionLoadResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_api_install_response.go b/services/postgresflex/v2api/model_api_install_response.go new file mode 100644 index 000000000..bc16252f4 --- /dev/null +++ b/services/postgresflex/v2api/model_api_install_response.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the ApiInstallResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApiInstallResponse{} + +// ApiInstallResponse struct for ApiInstallResponse +type ApiInstallResponse struct { + Extension *ApiExtensionList `json:"extension,omitempty"` +} + +// NewApiInstallResponse instantiates a new ApiInstallResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewApiInstallResponse() *ApiInstallResponse { + this := ApiInstallResponse{} + return &this +} + +// NewApiInstallResponseWithDefaults instantiates a new ApiInstallResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewApiInstallResponseWithDefaults() *ApiInstallResponse { + this := ApiInstallResponse{} + return &this +} + +// GetExtension returns the Extension field value if set, zero value otherwise. +func (o *ApiInstallResponse) GetExtension() ApiExtensionList { + if o == nil || IsNil(o.Extension) { + var ret ApiExtensionList + return ret + } + return *o.Extension +} + +// GetExtensionOk returns a tuple with the Extension field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApiInstallResponse) GetExtensionOk() (*ApiExtensionList, bool) { + if o == nil || IsNil(o.Extension) { + return nil, false + } + return o.Extension, true +} + +// HasExtension returns a boolean if a field has been set. +func (o *ApiInstallResponse) HasExtension() bool { + if o != nil && !IsNil(o.Extension) { + return true + } + + return false +} + +// SetExtension gets a reference to the given ApiExtensionList and assigns it to the Extension field. +func (o *ApiInstallResponse) SetExtension(v ApiExtensionList) { + o.Extension = &v +} + +func (o ApiInstallResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApiInstallResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Extension) { + toSerialize["extension"] = o.Extension + } + return toSerialize, nil +} + +type NullableApiInstallResponse struct { + value *ApiInstallResponse + isSet bool +} + +func (v NullableApiInstallResponse) Get() *ApiInstallResponse { + return v.value +} + +func (v *NullableApiInstallResponse) Set(val *ApiInstallResponse) { + v.value = val + v.isSet = true +} + +func (v NullableApiInstallResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableApiInstallResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApiInstallResponse(val *ApiInstallResponse) *NullableApiInstallResponse { + return &NullableApiInstallResponse{value: val, isSet: true} +} + +func (v NullableApiInstallResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApiInstallResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_api_installed_list_response.go b/services/postgresflex/v2api/model_api_installed_list_response.go new file mode 100644 index 000000000..62a4796d0 --- /dev/null +++ b/services/postgresflex/v2api/model_api_installed_list_response.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the ApiInstalledListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApiInstalledListResponse{} + +// ApiInstalledListResponse struct for ApiInstalledListResponse +type ApiInstalledListResponse struct { + Installed []ApiExtensionList `json:"installed,omitempty"` +} + +// NewApiInstalledListResponse instantiates a new ApiInstalledListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewApiInstalledListResponse() *ApiInstalledListResponse { + this := ApiInstalledListResponse{} + return &this +} + +// NewApiInstalledListResponseWithDefaults instantiates a new ApiInstalledListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewApiInstalledListResponseWithDefaults() *ApiInstalledListResponse { + this := ApiInstalledListResponse{} + return &this +} + +// GetInstalled returns the Installed field value if set, zero value otherwise. +func (o *ApiInstalledListResponse) GetInstalled() []ApiExtensionList { + if o == nil || IsNil(o.Installed) { + var ret []ApiExtensionList + return ret + } + return o.Installed +} + +// GetInstalledOk returns a tuple with the Installed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApiInstalledListResponse) GetInstalledOk() ([]ApiExtensionList, bool) { + if o == nil || IsNil(o.Installed) { + return nil, false + } + return o.Installed, true +} + +// HasInstalled returns a boolean if a field has been set. +func (o *ApiInstalledListResponse) HasInstalled() bool { + if o != nil && !IsNil(o.Installed) { + return true + } + + return false +} + +// SetInstalled gets a reference to the given []ApiExtensionList and assigns it to the Installed field. +func (o *ApiInstalledListResponse) SetInstalled(v []ApiExtensionList) { + o.Installed = v +} + +func (o ApiInstalledListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApiInstalledListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Installed) { + toSerialize["installed"] = o.Installed + } + return toSerialize, nil +} + +type NullableApiInstalledListResponse struct { + value *ApiInstalledListResponse + isSet bool +} + +func (v NullableApiInstalledListResponse) Get() *ApiInstalledListResponse { + return v.value +} + +func (v *NullableApiInstalledListResponse) Set(val *ApiInstalledListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableApiInstalledListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableApiInstalledListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApiInstalledListResponse(val *ApiInstalledListResponse) *NullableApiInstalledListResponse { + return &NullableApiInstalledListResponse{value: val, isSet: true} +} + +func (v NullableApiInstalledListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApiInstalledListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_backup.go b/services/postgresflex/v2api/model_backup.go new file mode 100644 index 000000000..a67a59910 --- /dev/null +++ b/services/postgresflex/v2api/model_backup.go @@ -0,0 +1,377 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the Backup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Backup{} + +// Backup struct for Backup +type Backup struct { + EndTime *string `json:"endTime,omitempty"` + Error *string `json:"error,omitempty"` + Id *string `json:"id,omitempty"` + Labels []string `json:"labels,omitempty"` + Name *string `json:"name,omitempty"` + Options *map[string]string `json:"options,omitempty"` + Size *int64 `json:"size,omitempty"` + StartTime *string `json:"startTime,omitempty"` +} + +// 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 +} + +// GetEndTime returns the EndTime field value if set, zero value otherwise. +func (o *Backup) GetEndTime() string { + if o == nil || IsNil(o.EndTime) { + var ret string + return ret + } + return *o.EndTime +} + +// GetEndTimeOk returns a tuple with the EndTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetEndTimeOk() (*string, bool) { + if o == nil || IsNil(o.EndTime) { + return nil, false + } + return o.EndTime, true +} + +// HasEndTime returns a boolean if a field has been set. +func (o *Backup) HasEndTime() bool { + if o != nil && !IsNil(o.EndTime) { + return true + } + + return false +} + +// SetEndTime gets a reference to the given string and assigns it to the EndTime field. +func (o *Backup) SetEndTime(v string) { + o.EndTime = &v +} + +// GetError returns the Error field value if set, zero value otherwise. +func (o *Backup) GetError() string { + if o == nil || IsNil(o.Error) { + var ret string + return ret + } + return *o.Error +} + +// GetErrorOk returns a tuple with the Error field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetErrorOk() (*string, bool) { + if o == nil || IsNil(o.Error) { + return nil, false + } + return o.Error, true +} + +// HasError returns a boolean if a field has been set. +func (o *Backup) HasError() bool { + if o != nil && !IsNil(o.Error) { + return true + } + + return false +} + +// SetError gets a reference to the given string and assigns it to the Error field. +func (o *Backup) SetError(v string) { + o.Error = &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() []string { + if o == nil || IsNil(o.Labels) { + var ret []string + 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() ([]string, bool) { + if o == nil || IsNil(o.Labels) { + return nil, 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 []string and assigns it to the Labels field. +func (o *Backup) SetLabels(v []string) { + 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 +} + +// GetOptions returns the Options field value if set, zero value otherwise. +func (o *Backup) GetOptions() map[string]string { + if o == nil || IsNil(o.Options) { + var ret map[string]string + return ret + } + return *o.Options +} + +// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetOptionsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Options) { + return nil, false + } + return o.Options, true +} + +// HasOptions returns a boolean if a field has been set. +func (o *Backup) HasOptions() bool { + if o != nil && !IsNil(o.Options) { + return true + } + + return false +} + +// SetOptions gets a reference to the given map[string]string and assigns it to the Options field. +func (o *Backup) SetOptions(v map[string]string) { + o.Options = &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 +} + +// GetStartTime returns the StartTime field value if set, zero value otherwise. +func (o *Backup) GetStartTime() string { + if o == nil || IsNil(o.StartTime) { + var ret string + return ret + } + return *o.StartTime +} + +// GetStartTimeOk returns a tuple with the StartTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetStartTimeOk() (*string, bool) { + if o == nil || IsNil(o.StartTime) { + return nil, false + } + return o.StartTime, true +} + +// HasStartTime returns a boolean if a field has been set. +func (o *Backup) HasStartTime() bool { + if o != nil && !IsNil(o.StartTime) { + return true + } + + return false +} + +// SetStartTime gets a reference to the given string and assigns it to the StartTime field. +func (o *Backup) SetStartTime(v string) { + o.StartTime = &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.EndTime) { + toSerialize["endTime"] = o.EndTime + } + if !IsNil(o.Error) { + toSerialize["error"] = o.Error + } + 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.Options) { + toSerialize["options"] = o.Options + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.StartTime) { + toSerialize["startTime"] = o.StartTime + } + 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/postgresflex/v2api/model_clone_instance_payload.go b/services/postgresflex/v2api/model_clone_instance_payload.go new file mode 100644 index 000000000..5b21765bd --- /dev/null +++ b/services/postgresflex/v2api/model_clone_instance_payload.go @@ -0,0 +1,198 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the CloneInstancePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CloneInstancePayload{} + +// CloneInstancePayload struct for CloneInstancePayload +type CloneInstancePayload struct { + Class *string `json:"class,omitempty"` + Size *int64 `json:"size,omitempty"` + // The timestamp should be specified in UTC time following the format provided in the example. + Timestamp *string `json:"timestamp,omitempty"` +} + +// NewCloneInstancePayload instantiates a new CloneInstancePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCloneInstancePayload() *CloneInstancePayload { + this := CloneInstancePayload{} + return &this +} + +// NewCloneInstancePayloadWithDefaults instantiates a new CloneInstancePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCloneInstancePayloadWithDefaults() *CloneInstancePayload { + this := CloneInstancePayload{} + return &this +} + +// GetClass returns the Class field value if set, zero value otherwise. +func (o *CloneInstancePayload) GetClass() string { + if o == nil || IsNil(o.Class) { + var ret string + return ret + } + return *o.Class +} + +// GetClassOk returns a tuple with the Class field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CloneInstancePayload) GetClassOk() (*string, bool) { + if o == nil || IsNil(o.Class) { + return nil, false + } + return o.Class, true +} + +// HasClass returns a boolean if a field has been set. +func (o *CloneInstancePayload) HasClass() bool { + if o != nil && !IsNil(o.Class) { + return true + } + + return false +} + +// SetClass gets a reference to the given string and assigns it to the Class field. +func (o *CloneInstancePayload) SetClass(v string) { + o.Class = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *CloneInstancePayload) 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 *CloneInstancePayload) 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 *CloneInstancePayload) 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 *CloneInstancePayload) SetSize(v int64) { + o.Size = &v +} + +// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +func (o *CloneInstancePayload) GetTimestamp() string { + if o == nil || IsNil(o.Timestamp) { + var ret string + return ret + } + return *o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CloneInstancePayload) GetTimestampOk() (*string, bool) { + if o == nil || IsNil(o.Timestamp) { + return nil, false + } + return o.Timestamp, true +} + +// HasTimestamp returns a boolean if a field has been set. +func (o *CloneInstancePayload) HasTimestamp() bool { + if o != nil && !IsNil(o.Timestamp) { + return true + } + + return false +} + +// SetTimestamp gets a reference to the given string and assigns it to the Timestamp field. +func (o *CloneInstancePayload) SetTimestamp(v string) { + o.Timestamp = &v +} + +func (o CloneInstancePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CloneInstancePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Class) { + toSerialize["class"] = o.Class + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.Timestamp) { + toSerialize["timestamp"] = o.Timestamp + } + return toSerialize, nil +} + +type NullableCloneInstancePayload struct { + value *CloneInstancePayload + isSet bool +} + +func (v NullableCloneInstancePayload) Get() *CloneInstancePayload { + return v.value +} + +func (v *NullableCloneInstancePayload) Set(val *CloneInstancePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCloneInstancePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCloneInstancePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCloneInstancePayload(val *CloneInstancePayload) *NullableCloneInstancePayload { + return &NullableCloneInstancePayload{value: val, isSet: true} +} + +func (v NullableCloneInstancePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCloneInstancePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_clone_instance_response.go b/services/postgresflex/v2api/model_clone_instance_response.go new file mode 100644 index 000000000..10748b4a1 --- /dev/null +++ b/services/postgresflex/v2api/model_clone_instance_response.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the CloneInstanceResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CloneInstanceResponse{} + +// CloneInstanceResponse struct for CloneInstanceResponse +type CloneInstanceResponse struct { + InstanceId *string `json:"instanceId,omitempty"` +} + +// NewCloneInstanceResponse instantiates a new CloneInstanceResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCloneInstanceResponse() *CloneInstanceResponse { + this := CloneInstanceResponse{} + return &this +} + +// NewCloneInstanceResponseWithDefaults instantiates a new CloneInstanceResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCloneInstanceResponseWithDefaults() *CloneInstanceResponse { + this := CloneInstanceResponse{} + return &this +} + +// GetInstanceId returns the InstanceId field value if set, zero value otherwise. +func (o *CloneInstanceResponse) GetInstanceId() string { + if o == nil || IsNil(o.InstanceId) { + var ret string + return ret + } + return *o.InstanceId +} + +// GetInstanceIdOk returns a tuple with the InstanceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CloneInstanceResponse) GetInstanceIdOk() (*string, bool) { + if o == nil || IsNil(o.InstanceId) { + return nil, false + } + return o.InstanceId, true +} + +// HasInstanceId returns a boolean if a field has been set. +func (o *CloneInstanceResponse) HasInstanceId() bool { + if o != nil && !IsNil(o.InstanceId) { + return true + } + + return false +} + +// SetInstanceId gets a reference to the given string and assigns it to the InstanceId field. +func (o *CloneInstanceResponse) SetInstanceId(v string) { + o.InstanceId = &v +} + +func (o CloneInstanceResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CloneInstanceResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.InstanceId) { + toSerialize["instanceId"] = o.InstanceId + } + return toSerialize, nil +} + +type NullableCloneInstanceResponse struct { + value *CloneInstanceResponse + isSet bool +} + +func (v NullableCloneInstanceResponse) Get() *CloneInstanceResponse { + return v.value +} + +func (v *NullableCloneInstanceResponse) Set(val *CloneInstanceResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCloneInstanceResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCloneInstanceResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCloneInstanceResponse(val *CloneInstanceResponse) *NullableCloneInstanceResponse { + return &NullableCloneInstanceResponse{value: val, isSet: true} +} + +func (v NullableCloneInstanceResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCloneInstanceResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_create_database_payload.go b/services/postgresflex/v2api/model_create_database_payload.go new file mode 100644 index 000000000..ba2f2c896 --- /dev/null +++ b/services/postgresflex/v2api/model_create_database_payload.go @@ -0,0 +1,162 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the CreateDatabasePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateDatabasePayload{} + +// CreateDatabasePayload struct for CreateDatabasePayload +type CreateDatabasePayload struct { + Name *string `json:"name,omitempty"` + // Database specific options + Options *map[string]string `json:"options,omitempty"` +} + +// NewCreateDatabasePayload instantiates a new CreateDatabasePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateDatabasePayload() *CreateDatabasePayload { + this := CreateDatabasePayload{} + return &this +} + +// NewCreateDatabasePayloadWithDefaults instantiates a new CreateDatabasePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateDatabasePayloadWithDefaults() *CreateDatabasePayload { + this := CreateDatabasePayload{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CreateDatabasePayload) 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 *CreateDatabasePayload) 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 *CreateDatabasePayload) 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 *CreateDatabasePayload) SetName(v string) { + o.Name = &v +} + +// GetOptions returns the Options field value if set, zero value otherwise. +func (o *CreateDatabasePayload) GetOptions() map[string]string { + if o == nil || IsNil(o.Options) { + var ret map[string]string + return ret + } + return *o.Options +} + +// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateDatabasePayload) GetOptionsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Options) { + return nil, false + } + return o.Options, true +} + +// HasOptions returns a boolean if a field has been set. +func (o *CreateDatabasePayload) HasOptions() bool { + if o != nil && !IsNil(o.Options) { + return true + } + + return false +} + +// SetOptions gets a reference to the given map[string]string and assigns it to the Options field. +func (o *CreateDatabasePayload) SetOptions(v map[string]string) { + o.Options = &v +} + +func (o CreateDatabasePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateDatabasePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Options) { + toSerialize["options"] = o.Options + } + return toSerialize, nil +} + +type NullableCreateDatabasePayload struct { + value *CreateDatabasePayload + isSet bool +} + +func (v NullableCreateDatabasePayload) Get() *CreateDatabasePayload { + return v.value +} + +func (v *NullableCreateDatabasePayload) Set(val *CreateDatabasePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateDatabasePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateDatabasePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateDatabasePayload(val *CreateDatabasePayload) *NullableCreateDatabasePayload { + return &NullableCreateDatabasePayload{value: val, isSet: true} +} + +func (v NullableCreateDatabasePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateDatabasePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_create_instance_payload.go b/services/postgresflex/v2api/model_create_instance_payload.go new file mode 100644 index 000000000..9a2c3d9fd --- /dev/null +++ b/services/postgresflex/v2api/model_create_instance_payload.go @@ -0,0 +1,390 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateInstancePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateInstancePayload{} + +// CreateInstancePayload struct for CreateInstancePayload +type CreateInstancePayload struct { + Acl ACL `json:"acl"` + BackupSchedule string `json:"backupSchedule"` + FlavorId string `json:"flavorId"` + // Labels field is not certain/clear + Labels *map[string]string `json:"labels,omitempty"` + Name string `json:"name"` + Options map[string]string `json:"options"` + Replicas int32 `json:"replicas"` + Storage Storage `json:"storage"` + Version string `json:"version"` +} + +type _CreateInstancePayload CreateInstancePayload + +// NewCreateInstancePayload instantiates a new CreateInstancePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateInstancePayload(acl ACL, backupSchedule string, flavorId string, name string, options map[string]string, replicas int32, storage Storage, version string) *CreateInstancePayload { + this := CreateInstancePayload{} + this.Acl = acl + this.BackupSchedule = backupSchedule + this.FlavorId = flavorId + this.Name = name + this.Options = options + this.Replicas = replicas + this.Storage = storage + this.Version = version + return &this +} + +// NewCreateInstancePayloadWithDefaults instantiates a new CreateInstancePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateInstancePayloadWithDefaults() *CreateInstancePayload { + this := CreateInstancePayload{} + return &this +} + +// GetAcl returns the Acl field value +func (o *CreateInstancePayload) GetAcl() ACL { + if o == nil { + var ret ACL + return ret + } + + return o.Acl +} + +// GetAclOk returns a tuple with the Acl field value +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetAclOk() (*ACL, bool) { + if o == nil { + return nil, false + } + return &o.Acl, true +} + +// SetAcl sets field value +func (o *CreateInstancePayload) SetAcl(v ACL) { + o.Acl = v +} + +// GetBackupSchedule returns the BackupSchedule field value +func (o *CreateInstancePayload) GetBackupSchedule() string { + if o == nil { + var ret string + return ret + } + + return o.BackupSchedule +} + +// GetBackupScheduleOk returns a tuple with the BackupSchedule field value +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetBackupScheduleOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BackupSchedule, true +} + +// SetBackupSchedule sets field value +func (o *CreateInstancePayload) SetBackupSchedule(v string) { + o.BackupSchedule = v +} + +// GetFlavorId returns the FlavorId field value +func (o *CreateInstancePayload) GetFlavorId() string { + if o == nil { + var ret string + return ret + } + + return o.FlavorId +} + +// GetFlavorIdOk returns a tuple with the FlavorId field value +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetFlavorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FlavorId, true +} + +// SetFlavorId sets field value +func (o *CreateInstancePayload) SetFlavorId(v string) { + o.FlavorId = v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateInstancePayload) GetLabels() map[string]string { + if o == nil || IsNil(o.Labels) { + var ret map[string]string + 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 *CreateInstancePayload) GetLabelsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Labels) { + return nil, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateInstancePayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *CreateInstancePayload) SetLabels(v map[string]string) { + o.Labels = &v +} + +// GetName returns the Name field value +func (o *CreateInstancePayload) 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 *CreateInstancePayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateInstancePayload) SetName(v string) { + o.Name = v +} + +// GetOptions returns the Options field value +func (o *CreateInstancePayload) GetOptions() map[string]string { + if o == nil { + var ret map[string]string + return ret + } + + return o.Options +} + +// GetOptionsOk returns a tuple with the Options field value +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetOptionsOk() (*map[string]string, bool) { + if o == nil { + return nil, false + } + return &o.Options, true +} + +// SetOptions sets field value +func (o *CreateInstancePayload) SetOptions(v map[string]string) { + o.Options = v +} + +// GetReplicas returns the Replicas field value +func (o *CreateInstancePayload) GetReplicas() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Replicas +} + +// GetReplicasOk returns a tuple with the Replicas field value +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetReplicasOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Replicas, true +} + +// SetReplicas sets field value +func (o *CreateInstancePayload) SetReplicas(v int32) { + o.Replicas = v +} + +// GetStorage returns the Storage field value +func (o *CreateInstancePayload) GetStorage() Storage { + if o == nil { + var ret Storage + return ret + } + + return o.Storage +} + +// GetStorageOk returns a tuple with the Storage field value +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetStorageOk() (*Storage, bool) { + if o == nil { + return nil, false + } + return &o.Storage, true +} + +// SetStorage sets field value +func (o *CreateInstancePayload) SetStorage(v Storage) { + o.Storage = v +} + +// GetVersion returns the Version field value +func (o *CreateInstancePayload) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *CreateInstancePayload) SetVersion(v string) { + o.Version = v +} + +func (o CreateInstancePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateInstancePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["acl"] = o.Acl + toSerialize["backupSchedule"] = o.BackupSchedule + toSerialize["flavorId"] = o.FlavorId + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + toSerialize["options"] = o.Options + toSerialize["replicas"] = o.Replicas + toSerialize["storage"] = o.Storage + toSerialize["version"] = o.Version + return toSerialize, nil +} + +func (o *CreateInstancePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "acl", + "backupSchedule", + "flavorId", + "name", + "options", + "replicas", + "storage", + "version", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateInstancePayload := _CreateInstancePayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateInstancePayload) + + if err != nil { + return err + } + + *o = CreateInstancePayload(varCreateInstancePayload) + + return err +} + +type NullableCreateInstancePayload struct { + value *CreateInstancePayload + isSet bool +} + +func (v NullableCreateInstancePayload) Get() *CreateInstancePayload { + return v.value +} + +func (v *NullableCreateInstancePayload) Set(val *CreateInstancePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateInstancePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateInstancePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateInstancePayload(val *CreateInstancePayload) *NullableCreateInstancePayload { + return &NullableCreateInstancePayload{value: val, isSet: true} +} + +func (v NullableCreateInstancePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateInstancePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_create_instance_response.go b/services/postgresflex/v2api/model_create_instance_response.go new file mode 100644 index 000000000..2769d9f30 --- /dev/null +++ b/services/postgresflex/v2api/model_create_instance_response.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the CreateInstanceResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateInstanceResponse{} + +// CreateInstanceResponse struct for CreateInstanceResponse +type CreateInstanceResponse struct { + Id *string `json:"id,omitempty"` +} + +// NewCreateInstanceResponse instantiates a new CreateInstanceResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateInstanceResponse() *CreateInstanceResponse { + this := CreateInstanceResponse{} + return &this +} + +// NewCreateInstanceResponseWithDefaults instantiates a new CreateInstanceResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateInstanceResponseWithDefaults() *CreateInstanceResponse { + this := CreateInstanceResponse{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CreateInstanceResponse) 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 *CreateInstanceResponse) 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 *CreateInstanceResponse) 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 *CreateInstanceResponse) SetId(v string) { + o.Id = &v +} + +func (o CreateInstanceResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateInstanceResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + return toSerialize, nil +} + +type NullableCreateInstanceResponse struct { + value *CreateInstanceResponse + isSet bool +} + +func (v NullableCreateInstanceResponse) Get() *CreateInstanceResponse { + return v.value +} + +func (v *NullableCreateInstanceResponse) Set(val *CreateInstanceResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCreateInstanceResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateInstanceResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateInstanceResponse(val *CreateInstanceResponse) *NullableCreateInstanceResponse { + return &NullableCreateInstanceResponse{value: val, isSet: true} +} + +func (v NullableCreateInstanceResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateInstanceResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_create_user_payload.go b/services/postgresflex/v2api/model_create_user_payload.go new file mode 100644 index 000000000..f9385ce66 --- /dev/null +++ b/services/postgresflex/v2api/model_create_user_payload.go @@ -0,0 +1,161 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the CreateUserPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateUserPayload{} + +// CreateUserPayload struct for CreateUserPayload +type CreateUserPayload struct { + Roles []string `json:"roles,omitempty"` + Username *string `json:"username,omitempty"` +} + +// NewCreateUserPayload instantiates a new CreateUserPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateUserPayload() *CreateUserPayload { + this := CreateUserPayload{} + return &this +} + +// NewCreateUserPayloadWithDefaults instantiates a new CreateUserPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateUserPayloadWithDefaults() *CreateUserPayload { + this := CreateUserPayload{} + return &this +} + +// GetRoles returns the Roles field value if set, zero value otherwise. +func (o *CreateUserPayload) GetRoles() []string { + if o == nil || IsNil(o.Roles) { + var ret []string + return ret + } + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateUserPayload) GetRolesOk() ([]string, bool) { + if o == nil || IsNil(o.Roles) { + return nil, false + } + return o.Roles, true +} + +// HasRoles returns a boolean if a field has been set. +func (o *CreateUserPayload) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { + return true + } + + return false +} + +// SetRoles gets a reference to the given []string and assigns it to the Roles field. +func (o *CreateUserPayload) SetRoles(v []string) { + o.Roles = v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *CreateUserPayload) GetUsername() string { + if o == nil || IsNil(o.Username) { + var ret string + return ret + } + return *o.Username +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateUserPayload) GetUsernameOk() (*string, bool) { + if o == nil || IsNil(o.Username) { + return nil, false + } + return o.Username, true +} + +// HasUsername returns a boolean if a field has been set. +func (o *CreateUserPayload) HasUsername() bool { + if o != nil && !IsNil(o.Username) { + return true + } + + return false +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *CreateUserPayload) SetUsername(v string) { + o.Username = &v +} + +func (o CreateUserPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateUserPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Roles) { + toSerialize["roles"] = o.Roles + } + if !IsNil(o.Username) { + toSerialize["username"] = o.Username + } + return toSerialize, nil +} + +type NullableCreateUserPayload struct { + value *CreateUserPayload + isSet bool +} + +func (v NullableCreateUserPayload) Get() *CreateUserPayload { + return v.value +} + +func (v *NullableCreateUserPayload) Set(val *CreateUserPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateUserPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateUserPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateUserPayload(val *CreateUserPayload) *NullableCreateUserPayload { + return &NullableCreateUserPayload{value: val, isSet: true} +} + +func (v NullableCreateUserPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateUserPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_create_user_response.go b/services/postgresflex/v2api/model_create_user_response.go new file mode 100644 index 000000000..14f5af072 --- /dev/null +++ b/services/postgresflex/v2api/model_create_user_response.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the CreateUserResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateUserResponse{} + +// CreateUserResponse struct for CreateUserResponse +type CreateUserResponse struct { + Item *User `json:"item,omitempty"` +} + +// NewCreateUserResponse instantiates a new CreateUserResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateUserResponse() *CreateUserResponse { + this := CreateUserResponse{} + return &this +} + +// NewCreateUserResponseWithDefaults instantiates a new CreateUserResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateUserResponseWithDefaults() *CreateUserResponse { + this := CreateUserResponse{} + return &this +} + +// GetItem returns the Item field value if set, zero value otherwise. +func (o *CreateUserResponse) GetItem() User { + if o == nil || IsNil(o.Item) { + var ret User + return ret + } + return *o.Item +} + +// GetItemOk returns a tuple with the Item field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateUserResponse) GetItemOk() (*User, bool) { + if o == nil || IsNil(o.Item) { + return nil, false + } + return o.Item, true +} + +// HasItem returns a boolean if a field has been set. +func (o *CreateUserResponse) HasItem() bool { + if o != nil && !IsNil(o.Item) { + return true + } + + return false +} + +// SetItem gets a reference to the given User and assigns it to the Item field. +func (o *CreateUserResponse) SetItem(v User) { + o.Item = &v +} + +func (o CreateUserResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateUserResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Item) { + toSerialize["item"] = o.Item + } + return toSerialize, nil +} + +type NullableCreateUserResponse struct { + value *CreateUserResponse + isSet bool +} + +func (v NullableCreateUserResponse) Get() *CreateUserResponse { + return v.value +} + +func (v *NullableCreateUserResponse) Set(val *CreateUserResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCreateUserResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateUserResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateUserResponse(val *CreateUserResponse) *NullableCreateUserResponse { + return &NullableCreateUserResponse{value: val, isSet: true} +} + +func (v NullableCreateUserResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateUserResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_error.go b/services/postgresflex/v2api/model_error.go new file mode 100644 index 000000000..aec79edb4 --- /dev/null +++ b/services/postgresflex/v2api/model_error.go @@ -0,0 +1,233 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the Error type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Error{} + +// Error struct for Error +type Error struct { + Code *int32 `json:"code,omitempty"` + Fields *map[string][]string `json:"fields,omitempty"` + Message *string `json:"message,omitempty"` + Type *string `json:"type,omitempty"` +} + +// 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() *Error { + this := Error{} + 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 if set, zero value otherwise. +func (o *Error) GetCode() int32 { + if o == nil || IsNil(o.Code) { + var ret int32 + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Error) GetCodeOk() (*int32, bool) { + if o == nil || IsNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *Error) HasCode() bool { + if o != nil && !IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given int32 and assigns it to the Code field. +func (o *Error) SetCode(v int32) { + o.Code = &v +} + +// GetFields returns the Fields field value if set, zero value otherwise. +func (o *Error) GetFields() map[string][]string { + if o == nil || IsNil(o.Fields) { + var ret map[string][]string + return ret + } + return *o.Fields +} + +// GetFieldsOk returns a tuple with the Fields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Error) GetFieldsOk() (*map[string][]string, bool) { + if o == nil || IsNil(o.Fields) { + return nil, false + } + return o.Fields, true +} + +// HasFields returns a boolean if a field has been set. +func (o *Error) HasFields() bool { + if o != nil && !IsNil(o.Fields) { + return true + } + + return false +} + +// SetFields gets a reference to the given map[string][]string and assigns it to the Fields field. +func (o *Error) SetFields(v map[string][]string) { + o.Fields = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *Error) GetMessage() string { + if o == nil || IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Error) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *Error) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *Error) SetMessage(v string) { + o.Message = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *Error) 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 *Error) 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 *Error) 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 *Error) SetType(v string) { + o.Type = &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{}{} + if !IsNil(o.Code) { + toSerialize["code"] = o.Code + } + if !IsNil(o.Fields) { + toSerialize["fields"] = o.Fields + } + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +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/postgresflex/v2api/model_extensions_configuration.go b/services/postgresflex/v2api/model_extensions_configuration.go new file mode 100644 index 000000000..7fd895d50 --- /dev/null +++ b/services/postgresflex/v2api/model_extensions_configuration.go @@ -0,0 +1,161 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the ExtensionsConfiguration type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ExtensionsConfiguration{} + +// ExtensionsConfiguration struct for ExtensionsConfiguration +type ExtensionsConfiguration struct { + Name *string `json:"name,omitempty"` + Setting *string `json:"setting,omitempty"` +} + +// NewExtensionsConfiguration instantiates a new ExtensionsConfiguration object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewExtensionsConfiguration() *ExtensionsConfiguration { + this := ExtensionsConfiguration{} + return &this +} + +// NewExtensionsConfigurationWithDefaults instantiates a new ExtensionsConfiguration object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewExtensionsConfigurationWithDefaults() *ExtensionsConfiguration { + this := ExtensionsConfiguration{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *ExtensionsConfiguration) 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 *ExtensionsConfiguration) 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 *ExtensionsConfiguration) 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 *ExtensionsConfiguration) SetName(v string) { + o.Name = &v +} + +// GetSetting returns the Setting field value if set, zero value otherwise. +func (o *ExtensionsConfiguration) GetSetting() string { + if o == nil || IsNil(o.Setting) { + var ret string + return ret + } + return *o.Setting +} + +// GetSettingOk returns a tuple with the Setting field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ExtensionsConfiguration) GetSettingOk() (*string, bool) { + if o == nil || IsNil(o.Setting) { + return nil, false + } + return o.Setting, true +} + +// HasSetting returns a boolean if a field has been set. +func (o *ExtensionsConfiguration) HasSetting() bool { + if o != nil && !IsNil(o.Setting) { + return true + } + + return false +} + +// SetSetting gets a reference to the given string and assigns it to the Setting field. +func (o *ExtensionsConfiguration) SetSetting(v string) { + o.Setting = &v +} + +func (o ExtensionsConfiguration) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ExtensionsConfiguration) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Setting) { + toSerialize["setting"] = o.Setting + } + return toSerialize, nil +} + +type NullableExtensionsConfiguration struct { + value *ExtensionsConfiguration + isSet bool +} + +func (v NullableExtensionsConfiguration) Get() *ExtensionsConfiguration { + return v.value +} + +func (v *NullableExtensionsConfiguration) Set(val *ExtensionsConfiguration) { + v.value = val + v.isSet = true +} + +func (v NullableExtensionsConfiguration) IsSet() bool { + return v.isSet +} + +func (v *NullableExtensionsConfiguration) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableExtensionsConfiguration(val *ExtensionsConfiguration) *NullableExtensionsConfiguration { + return &NullableExtensionsConfiguration{value: val, isSet: true} +} + +func (v NullableExtensionsConfiguration) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableExtensionsConfiguration) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_extensions_extension_list_response.go b/services/postgresflex/v2api/model_extensions_extension_list_response.go new file mode 100644 index 000000000..75a7f75f1 --- /dev/null +++ b/services/postgresflex/v2api/model_extensions_extension_list_response.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the ExtensionsExtensionListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ExtensionsExtensionListResponse{} + +// ExtensionsExtensionListResponse struct for ExtensionsExtensionListResponse +type ExtensionsExtensionListResponse struct { + List []ApiExtensionList `json:"list,omitempty"` +} + +// NewExtensionsExtensionListResponse instantiates a new ExtensionsExtensionListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewExtensionsExtensionListResponse() *ExtensionsExtensionListResponse { + this := ExtensionsExtensionListResponse{} + return &this +} + +// NewExtensionsExtensionListResponseWithDefaults instantiates a new ExtensionsExtensionListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewExtensionsExtensionListResponseWithDefaults() *ExtensionsExtensionListResponse { + this := ExtensionsExtensionListResponse{} + return &this +} + +// GetList returns the List field value if set, zero value otherwise. +func (o *ExtensionsExtensionListResponse) GetList() []ApiExtensionList { + if o == nil || IsNil(o.List) { + var ret []ApiExtensionList + return ret + } + return o.List +} + +// GetListOk returns a tuple with the List field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ExtensionsExtensionListResponse) GetListOk() ([]ApiExtensionList, bool) { + if o == nil || IsNil(o.List) { + return nil, false + } + return o.List, true +} + +// HasList returns a boolean if a field has been set. +func (o *ExtensionsExtensionListResponse) HasList() bool { + if o != nil && !IsNil(o.List) { + return true + } + + return false +} + +// SetList gets a reference to the given []ApiExtensionList and assigns it to the List field. +func (o *ExtensionsExtensionListResponse) SetList(v []ApiExtensionList) { + o.List = v +} + +func (o ExtensionsExtensionListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ExtensionsExtensionListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.List) { + toSerialize["list"] = o.List + } + return toSerialize, nil +} + +type NullableExtensionsExtensionListResponse struct { + value *ExtensionsExtensionListResponse + isSet bool +} + +func (v NullableExtensionsExtensionListResponse) Get() *ExtensionsExtensionListResponse { + return v.value +} + +func (v *NullableExtensionsExtensionListResponse) Set(val *ExtensionsExtensionListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableExtensionsExtensionListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableExtensionsExtensionListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableExtensionsExtensionListResponse(val *ExtensionsExtensionListResponse) *NullableExtensionsExtensionListResponse { + return &NullableExtensionsExtensionListResponse{value: val, isSet: true} +} + +func (v NullableExtensionsExtensionListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableExtensionsExtensionListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_extensions_new_config.go b/services/postgresflex/v2api/model_extensions_new_config.go new file mode 100644 index 000000000..0e37344eb --- /dev/null +++ b/services/postgresflex/v2api/model_extensions_new_config.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the ExtensionsNewConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ExtensionsNewConfig{} + +// ExtensionsNewConfig struct for ExtensionsNewConfig +type ExtensionsNewConfig struct { + Configuration []ExtensionsConfiguration `json:"configuration,omitempty"` +} + +// NewExtensionsNewConfig instantiates a new ExtensionsNewConfig object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewExtensionsNewConfig() *ExtensionsNewConfig { + this := ExtensionsNewConfig{} + return &this +} + +// NewExtensionsNewConfigWithDefaults instantiates a new ExtensionsNewConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewExtensionsNewConfigWithDefaults() *ExtensionsNewConfig { + this := ExtensionsNewConfig{} + return &this +} + +// GetConfiguration returns the Configuration field value if set, zero value otherwise. +func (o *ExtensionsNewConfig) GetConfiguration() []ExtensionsConfiguration { + if o == nil || IsNil(o.Configuration) { + var ret []ExtensionsConfiguration + return ret + } + return o.Configuration +} + +// GetConfigurationOk returns a tuple with the Configuration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ExtensionsNewConfig) GetConfigurationOk() ([]ExtensionsConfiguration, bool) { + if o == nil || IsNil(o.Configuration) { + return nil, false + } + return o.Configuration, true +} + +// HasConfiguration returns a boolean if a field has been set. +func (o *ExtensionsNewConfig) HasConfiguration() bool { + if o != nil && !IsNil(o.Configuration) { + return true + } + + return false +} + +// SetConfiguration gets a reference to the given []ExtensionsConfiguration and assigns it to the Configuration field. +func (o *ExtensionsNewConfig) SetConfiguration(v []ExtensionsConfiguration) { + o.Configuration = v +} + +func (o ExtensionsNewConfig) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ExtensionsNewConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Configuration) { + toSerialize["configuration"] = o.Configuration + } + return toSerialize, nil +} + +type NullableExtensionsNewConfig struct { + value *ExtensionsNewConfig + isSet bool +} + +func (v NullableExtensionsNewConfig) Get() *ExtensionsNewConfig { + return v.value +} + +func (v *NullableExtensionsNewConfig) Set(val *ExtensionsNewConfig) { + v.value = val + v.isSet = true +} + +func (v NullableExtensionsNewConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableExtensionsNewConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableExtensionsNewConfig(val *ExtensionsNewConfig) *NullableExtensionsNewConfig { + return &NullableExtensionsNewConfig{value: val, isSet: true} +} + +func (v NullableExtensionsNewConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableExtensionsNewConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_flavor.go b/services/postgresflex/v2api/model_flavor.go new file mode 100644 index 000000000..07f7d077f --- /dev/null +++ b/services/postgresflex/v2api/model_flavor.go @@ -0,0 +1,233 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the Flavor type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Flavor{} + +// Flavor struct for Flavor +type Flavor struct { + Cpu *int64 `json:"cpu,omitempty"` + Description *string `json:"description,omitempty"` + Id *string `json:"id,omitempty"` + Memory *int64 `json:"memory,omitempty"` +} + +// NewFlavor instantiates a new Flavor object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFlavor() *Flavor { + this := Flavor{} + return &this +} + +// NewFlavorWithDefaults instantiates a new Flavor object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFlavorWithDefaults() *Flavor { + this := Flavor{} + return &this +} + +// GetCpu returns the Cpu field value if set, zero value otherwise. +func (o *Flavor) GetCpu() int64 { + if o == nil || IsNil(o.Cpu) { + var ret int64 + return ret + } + return *o.Cpu +} + +// GetCpuOk returns a tuple with the Cpu field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Flavor) GetCpuOk() (*int64, bool) { + if o == nil || IsNil(o.Cpu) { + return nil, false + } + return o.Cpu, true +} + +// HasCpu returns a boolean if a field has been set. +func (o *Flavor) HasCpu() bool { + if o != nil && !IsNil(o.Cpu) { + return true + } + + return false +} + +// SetCpu gets a reference to the given int64 and assigns it to the Cpu field. +func (o *Flavor) SetCpu(v int64) { + o.Cpu = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Flavor) 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 *Flavor) 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 *Flavor) 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 *Flavor) SetDescription(v string) { + o.Description = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Flavor) 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 *Flavor) 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 *Flavor) 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 *Flavor) SetId(v string) { + o.Id = &v +} + +// GetMemory returns the Memory field value if set, zero value otherwise. +func (o *Flavor) GetMemory() int64 { + if o == nil || IsNil(o.Memory) { + var ret int64 + return ret + } + return *o.Memory +} + +// GetMemoryOk returns a tuple with the Memory field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Flavor) GetMemoryOk() (*int64, bool) { + if o == nil || IsNil(o.Memory) { + return nil, false + } + return o.Memory, true +} + +// HasMemory returns a boolean if a field has been set. +func (o *Flavor) HasMemory() bool { + if o != nil && !IsNil(o.Memory) { + return true + } + + return false +} + +// SetMemory gets a reference to the given int64 and assigns it to the Memory field. +func (o *Flavor) SetMemory(v int64) { + o.Memory = &v +} + +func (o Flavor) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Flavor) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Cpu) { + toSerialize["cpu"] = o.Cpu + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Memory) { + toSerialize["memory"] = o.Memory + } + return toSerialize, nil +} + +type NullableFlavor struct { + value *Flavor + isSet bool +} + +func (v NullableFlavor) Get() *Flavor { + return v.value +} + +func (v *NullableFlavor) Set(val *Flavor) { + v.value = val + v.isSet = true +} + +func (v NullableFlavor) IsSet() bool { + return v.isSet +} + +func (v *NullableFlavor) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFlavor(val *Flavor) *NullableFlavor { + return &NullableFlavor{value: val, isSet: true} +} + +func (v NullableFlavor) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFlavor) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_get_backup_response.go b/services/postgresflex/v2api/model_get_backup_response.go new file mode 100644 index 000000000..7c9b4df98 --- /dev/null +++ b/services/postgresflex/v2api/model_get_backup_response.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the GetBackupResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBackupResponse{} + +// GetBackupResponse struct for GetBackupResponse +type GetBackupResponse struct { + Item *Backup `json:"item,omitempty"` +} + +// NewGetBackupResponse instantiates a new GetBackupResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetBackupResponse() *GetBackupResponse { + this := GetBackupResponse{} + return &this +} + +// NewGetBackupResponseWithDefaults instantiates a new GetBackupResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetBackupResponseWithDefaults() *GetBackupResponse { + this := GetBackupResponse{} + return &this +} + +// GetItem returns the Item field value if set, zero value otherwise. +func (o *GetBackupResponse) GetItem() Backup { + if o == nil || IsNil(o.Item) { + var ret Backup + return ret + } + return *o.Item +} + +// GetItemOk returns a tuple with the Item field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBackupResponse) GetItemOk() (*Backup, bool) { + if o == nil || IsNil(o.Item) { + return nil, false + } + return o.Item, true +} + +// HasItem returns a boolean if a field has been set. +func (o *GetBackupResponse) HasItem() bool { + if o != nil && !IsNil(o.Item) { + return true + } + + return false +} + +// SetItem gets a reference to the given Backup and assigns it to the Item field. +func (o *GetBackupResponse) SetItem(v Backup) { + o.Item = &v +} + +func (o GetBackupResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBackupResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Item) { + toSerialize["item"] = o.Item + } + return toSerialize, nil +} + +type NullableGetBackupResponse struct { + value *GetBackupResponse + isSet bool +} + +func (v NullableGetBackupResponse) Get() *GetBackupResponse { + return v.value +} + +func (v *NullableGetBackupResponse) Set(val *GetBackupResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetBackupResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBackupResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBackupResponse(val *GetBackupResponse) *NullableGetBackupResponse { + return &NullableGetBackupResponse{value: val, isSet: true} +} + +func (v NullableGetBackupResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBackupResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_get_user_response.go b/services/postgresflex/v2api/model_get_user_response.go new file mode 100644 index 000000000..bb392cd14 --- /dev/null +++ b/services/postgresflex/v2api/model_get_user_response.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the GetUserResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetUserResponse{} + +// GetUserResponse struct for GetUserResponse +type GetUserResponse struct { + Item *UserResponse `json:"item,omitempty"` +} + +// NewGetUserResponse instantiates a new GetUserResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetUserResponse() *GetUserResponse { + this := GetUserResponse{} + return &this +} + +// NewGetUserResponseWithDefaults instantiates a new GetUserResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetUserResponseWithDefaults() *GetUserResponse { + this := GetUserResponse{} + return &this +} + +// GetItem returns the Item field value if set, zero value otherwise. +func (o *GetUserResponse) GetItem() UserResponse { + if o == nil || IsNil(o.Item) { + var ret UserResponse + return ret + } + return *o.Item +} + +// GetItemOk returns a tuple with the Item field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetUserResponse) GetItemOk() (*UserResponse, bool) { + if o == nil || IsNil(o.Item) { + return nil, false + } + return o.Item, true +} + +// HasItem returns a boolean if a field has been set. +func (o *GetUserResponse) HasItem() bool { + if o != nil && !IsNil(o.Item) { + return true + } + + return false +} + +// SetItem gets a reference to the given UserResponse and assigns it to the Item field. +func (o *GetUserResponse) SetItem(v UserResponse) { + o.Item = &v +} + +func (o GetUserResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetUserResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Item) { + toSerialize["item"] = o.Item + } + return toSerialize, nil +} + +type NullableGetUserResponse struct { + value *GetUserResponse + isSet bool +} + +func (v NullableGetUserResponse) Get() *GetUserResponse { + return v.value +} + +func (v *NullableGetUserResponse) Set(val *GetUserResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetUserResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetUserResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetUserResponse(val *GetUserResponse) *NullableGetUserResponse { + return &NullableGetUserResponse{value: val, isSet: true} +} + +func (v NullableGetUserResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetUserResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_instance.go b/services/postgresflex/v2api/model_instance.go new file mode 100644 index 000000000..c10e2d20d --- /dev/null +++ b/services/postgresflex/v2api/model_instance.go @@ -0,0 +1,449 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the Instance type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Instance{} + +// Instance struct for Instance +type Instance struct { + Acl *ACL `json:"acl,omitempty"` + BackupSchedule *string `json:"backupSchedule,omitempty"` + Flavor *Flavor `json:"flavor,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Options *map[string]string `json:"options,omitempty"` + Replicas *int32 `json:"replicas,omitempty"` + Status *string `json:"status,omitempty"` + Storage *Storage `json:"storage,omitempty"` + Version *string `json:"version,omitempty"` +} + +// NewInstance instantiates a new Instance object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstance() *Instance { + this := Instance{} + return &this +} + +// NewInstanceWithDefaults instantiates a new Instance object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceWithDefaults() *Instance { + this := Instance{} + return &this +} + +// GetAcl returns the Acl field value if set, zero value otherwise. +func (o *Instance) GetAcl() ACL { + if o == nil || IsNil(o.Acl) { + var ret ACL + return ret + } + return *o.Acl +} + +// GetAclOk returns a tuple with the Acl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Instance) GetAclOk() (*ACL, bool) { + if o == nil || IsNil(o.Acl) { + return nil, false + } + return o.Acl, true +} + +// HasAcl returns a boolean if a field has been set. +func (o *Instance) HasAcl() bool { + if o != nil && !IsNil(o.Acl) { + return true + } + + return false +} + +// SetAcl gets a reference to the given ACL and assigns it to the Acl field. +func (o *Instance) SetAcl(v ACL) { + o.Acl = &v +} + +// GetBackupSchedule returns the BackupSchedule field value if set, zero value otherwise. +func (o *Instance) GetBackupSchedule() string { + if o == nil || IsNil(o.BackupSchedule) { + var ret string + return ret + } + return *o.BackupSchedule +} + +// GetBackupScheduleOk returns a tuple with the BackupSchedule field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Instance) GetBackupScheduleOk() (*string, bool) { + if o == nil || IsNil(o.BackupSchedule) { + return nil, false + } + return o.BackupSchedule, true +} + +// HasBackupSchedule returns a boolean if a field has been set. +func (o *Instance) HasBackupSchedule() bool { + if o != nil && !IsNil(o.BackupSchedule) { + return true + } + + return false +} + +// SetBackupSchedule gets a reference to the given string and assigns it to the BackupSchedule field. +func (o *Instance) SetBackupSchedule(v string) { + o.BackupSchedule = &v +} + +// GetFlavor returns the Flavor field value if set, zero value otherwise. +func (o *Instance) GetFlavor() Flavor { + if o == nil || IsNil(o.Flavor) { + var ret Flavor + return ret + } + return *o.Flavor +} + +// GetFlavorOk returns a tuple with the Flavor field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Instance) GetFlavorOk() (*Flavor, bool) { + if o == nil || IsNil(o.Flavor) { + return nil, false + } + return o.Flavor, true +} + +// HasFlavor returns a boolean if a field has been set. +func (o *Instance) HasFlavor() bool { + if o != nil && !IsNil(o.Flavor) { + return true + } + + return false +} + +// SetFlavor gets a reference to the given Flavor and assigns it to the Flavor field. +func (o *Instance) SetFlavor(v Flavor) { + o.Flavor = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Instance) 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 *Instance) 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 *Instance) 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 *Instance) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Instance) 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 *Instance) 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 *Instance) 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 *Instance) SetName(v string) { + o.Name = &v +} + +// GetOptions returns the Options field value if set, zero value otherwise. +func (o *Instance) GetOptions() map[string]string { + if o == nil || IsNil(o.Options) { + var ret map[string]string + return ret + } + return *o.Options +} + +// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Instance) GetOptionsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Options) { + return nil, false + } + return o.Options, true +} + +// HasOptions returns a boolean if a field has been set. +func (o *Instance) HasOptions() bool { + if o != nil && !IsNil(o.Options) { + return true + } + + return false +} + +// SetOptions gets a reference to the given map[string]string and assigns it to the Options field. +func (o *Instance) SetOptions(v map[string]string) { + o.Options = &v +} + +// GetReplicas returns the Replicas field value if set, zero value otherwise. +func (o *Instance) GetReplicas() int32 { + if o == nil || IsNil(o.Replicas) { + var ret int32 + return ret + } + return *o.Replicas +} + +// GetReplicasOk returns a tuple with the Replicas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Instance) GetReplicasOk() (*int32, bool) { + if o == nil || IsNil(o.Replicas) { + return nil, false + } + return o.Replicas, true +} + +// HasReplicas returns a boolean if a field has been set. +func (o *Instance) HasReplicas() bool { + if o != nil && !IsNil(o.Replicas) { + return true + } + + return false +} + +// SetReplicas gets a reference to the given int32 and assigns it to the Replicas field. +func (o *Instance) SetReplicas(v int32) { + o.Replicas = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Instance) 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 *Instance) 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 *Instance) 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 *Instance) SetStatus(v string) { + o.Status = &v +} + +// GetStorage returns the Storage field value if set, zero value otherwise. +func (o *Instance) GetStorage() Storage { + if o == nil || IsNil(o.Storage) { + var ret Storage + return ret + } + return *o.Storage +} + +// GetStorageOk returns a tuple with the Storage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Instance) GetStorageOk() (*Storage, bool) { + if o == nil || IsNil(o.Storage) { + return nil, false + } + return o.Storage, true +} + +// HasStorage returns a boolean if a field has been set. +func (o *Instance) HasStorage() bool { + if o != nil && !IsNil(o.Storage) { + return true + } + + return false +} + +// SetStorage gets a reference to the given Storage and assigns it to the Storage field. +func (o *Instance) SetStorage(v Storage) { + o.Storage = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *Instance) GetVersion() string { + if o == nil || IsNil(o.Version) { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Instance) GetVersionOk() (*string, bool) { + if o == nil || IsNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *Instance) HasVersion() bool { + if o != nil && !IsNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *Instance) SetVersion(v string) { + o.Version = &v +} + +func (o Instance) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Instance) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Acl) { + toSerialize["acl"] = o.Acl + } + if !IsNil(o.BackupSchedule) { + toSerialize["backupSchedule"] = o.BackupSchedule + } + if !IsNil(o.Flavor) { + toSerialize["flavor"] = o.Flavor + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Options) { + toSerialize["options"] = o.Options + } + if !IsNil(o.Replicas) { + toSerialize["replicas"] = o.Replicas + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Storage) { + toSerialize["storage"] = o.Storage + } + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + return toSerialize, nil +} + +type NullableInstance struct { + value *Instance + isSet bool +} + +func (v NullableInstance) Get() *Instance { + return v.value +} + +func (v *NullableInstance) Set(val *Instance) { + v.value = val + v.isSet = true +} + +func (v NullableInstance) IsSet() bool { + return v.isSet +} + +func (v *NullableInstance) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstance(val *Instance) *NullableInstance { + return &NullableInstance{value: val, isSet: true} +} + +func (v NullableInstance) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstance) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_instance_create_database_response.go b/services/postgresflex/v2api/model_instance_create_database_response.go new file mode 100644 index 000000000..8a111a7ff --- /dev/null +++ b/services/postgresflex/v2api/model_instance_create_database_response.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the InstanceCreateDatabaseResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceCreateDatabaseResponse{} + +// InstanceCreateDatabaseResponse struct for InstanceCreateDatabaseResponse +type InstanceCreateDatabaseResponse struct { + Id *string `json:"id,omitempty"` +} + +// NewInstanceCreateDatabaseResponse instantiates a new InstanceCreateDatabaseResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceCreateDatabaseResponse() *InstanceCreateDatabaseResponse { + this := InstanceCreateDatabaseResponse{} + return &this +} + +// NewInstanceCreateDatabaseResponseWithDefaults instantiates a new InstanceCreateDatabaseResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceCreateDatabaseResponseWithDefaults() *InstanceCreateDatabaseResponse { + this := InstanceCreateDatabaseResponse{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *InstanceCreateDatabaseResponse) 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 *InstanceCreateDatabaseResponse) 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 *InstanceCreateDatabaseResponse) 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 *InstanceCreateDatabaseResponse) SetId(v string) { + o.Id = &v +} + +func (o InstanceCreateDatabaseResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceCreateDatabaseResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + return toSerialize, nil +} + +type NullableInstanceCreateDatabaseResponse struct { + value *InstanceCreateDatabaseResponse + isSet bool +} + +func (v NullableInstanceCreateDatabaseResponse) Get() *InstanceCreateDatabaseResponse { + return v.value +} + +func (v *NullableInstanceCreateDatabaseResponse) Set(val *InstanceCreateDatabaseResponse) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceCreateDatabaseResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceCreateDatabaseResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceCreateDatabaseResponse(val *InstanceCreateDatabaseResponse) *NullableInstanceCreateDatabaseResponse { + return &NullableInstanceCreateDatabaseResponse{value: val, isSet: true} +} + +func (v NullableInstanceCreateDatabaseResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceCreateDatabaseResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_instance_data_point.go b/services/postgresflex/v2api/model_instance_data_point.go new file mode 100644 index 000000000..77ceaec1e --- /dev/null +++ b/services/postgresflex/v2api/model_instance_data_point.go @@ -0,0 +1,161 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the InstanceDataPoint type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceDataPoint{} + +// InstanceDataPoint struct for InstanceDataPoint +type InstanceDataPoint struct { + Timestamp *string `json:"timestamp,omitempty"` + Value *float32 `json:"value,omitempty"` +} + +// NewInstanceDataPoint instantiates a new InstanceDataPoint object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceDataPoint() *InstanceDataPoint { + this := InstanceDataPoint{} + return &this +} + +// NewInstanceDataPointWithDefaults instantiates a new InstanceDataPoint object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceDataPointWithDefaults() *InstanceDataPoint { + this := InstanceDataPoint{} + return &this +} + +// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +func (o *InstanceDataPoint) GetTimestamp() string { + if o == nil || IsNil(o.Timestamp) { + var ret string + return ret + } + return *o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceDataPoint) GetTimestampOk() (*string, bool) { + if o == nil || IsNil(o.Timestamp) { + return nil, false + } + return o.Timestamp, true +} + +// HasTimestamp returns a boolean if a field has been set. +func (o *InstanceDataPoint) HasTimestamp() bool { + if o != nil && !IsNil(o.Timestamp) { + return true + } + + return false +} + +// SetTimestamp gets a reference to the given string and assigns it to the Timestamp field. +func (o *InstanceDataPoint) SetTimestamp(v string) { + o.Timestamp = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *InstanceDataPoint) GetValue() float32 { + if o == nil || IsNil(o.Value) { + var ret float32 + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceDataPoint) GetValueOk() (*float32, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *InstanceDataPoint) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given float32 and assigns it to the Value field. +func (o *InstanceDataPoint) SetValue(v float32) { + o.Value = &v +} + +func (o InstanceDataPoint) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceDataPoint) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Timestamp) { + toSerialize["timestamp"] = o.Timestamp + } + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + return toSerialize, nil +} + +type NullableInstanceDataPoint struct { + value *InstanceDataPoint + isSet bool +} + +func (v NullableInstanceDataPoint) Get() *InstanceDataPoint { + return v.value +} + +func (v *NullableInstanceDataPoint) Set(val *InstanceDataPoint) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceDataPoint) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceDataPoint) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceDataPoint(val *InstanceDataPoint) *NullableInstanceDataPoint { + return &NullableInstanceDataPoint{value: val, isSet: true} +} + +func (v NullableInstanceDataPoint) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceDataPoint) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_instance_database.go b/services/postgresflex/v2api/model_instance_database.go new file mode 100644 index 000000000..8462dbdc6 --- /dev/null +++ b/services/postgresflex/v2api/model_instance_database.go @@ -0,0 +1,198 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the InstanceDatabase type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceDatabase{} + +// InstanceDatabase struct for InstanceDatabase +type InstanceDatabase struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + // Database specific options + Options map[string]interface{} `json:"options,omitempty"` +} + +// NewInstanceDatabase instantiates a new InstanceDatabase object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceDatabase() *InstanceDatabase { + this := InstanceDatabase{} + return &this +} + +// NewInstanceDatabaseWithDefaults instantiates a new InstanceDatabase object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceDatabaseWithDefaults() *InstanceDatabase { + this := InstanceDatabase{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *InstanceDatabase) 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 *InstanceDatabase) 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 *InstanceDatabase) 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 *InstanceDatabase) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *InstanceDatabase) 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 *InstanceDatabase) 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 *InstanceDatabase) 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 *InstanceDatabase) SetName(v string) { + o.Name = &v +} + +// GetOptions returns the Options field value if set, zero value otherwise. +func (o *InstanceDatabase) GetOptions() map[string]interface{} { + if o == nil || IsNil(o.Options) { + var ret map[string]interface{} + return ret + } + return o.Options +} + +// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceDatabase) GetOptionsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Options) { + return map[string]interface{}{}, false + } + return o.Options, true +} + +// HasOptions returns a boolean if a field has been set. +func (o *InstanceDatabase) HasOptions() bool { + if o != nil && !IsNil(o.Options) { + return true + } + + return false +} + +// SetOptions gets a reference to the given map[string]interface{} and assigns it to the Options field. +func (o *InstanceDatabase) SetOptions(v map[string]interface{}) { + o.Options = v +} + +func (o InstanceDatabase) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceDatabase) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Options) { + toSerialize["options"] = o.Options + } + return toSerialize, nil +} + +type NullableInstanceDatabase struct { + value *InstanceDatabase + isSet bool +} + +func (v NullableInstanceDatabase) Get() *InstanceDatabase { + return v.value +} + +func (v *NullableInstanceDatabase) Set(val *InstanceDatabase) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceDatabase) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceDatabase) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceDatabase(val *InstanceDatabase) *NullableInstanceDatabase { + return &NullableInstanceDatabase{value: val, isSet: true} +} + +func (v NullableInstanceDatabase) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceDatabase) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_instance_host.go b/services/postgresflex/v2api/model_instance_host.go new file mode 100644 index 000000000..febb8f414 --- /dev/null +++ b/services/postgresflex/v2api/model_instance_host.go @@ -0,0 +1,161 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the InstanceHost type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceHost{} + +// InstanceHost struct for InstanceHost +type InstanceHost struct { + HostMetrics []InstanceHostMetric `json:"hostMetrics,omitempty"` + Id *string `json:"id,omitempty"` +} + +// NewInstanceHost instantiates a new InstanceHost object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceHost() *InstanceHost { + this := InstanceHost{} + return &this +} + +// NewInstanceHostWithDefaults instantiates a new InstanceHost object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceHostWithDefaults() *InstanceHost { + this := InstanceHost{} + return &this +} + +// GetHostMetrics returns the HostMetrics field value if set, zero value otherwise. +func (o *InstanceHost) GetHostMetrics() []InstanceHostMetric { + if o == nil || IsNil(o.HostMetrics) { + var ret []InstanceHostMetric + return ret + } + return o.HostMetrics +} + +// GetHostMetricsOk returns a tuple with the HostMetrics field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceHost) GetHostMetricsOk() ([]InstanceHostMetric, bool) { + if o == nil || IsNil(o.HostMetrics) { + return nil, false + } + return o.HostMetrics, true +} + +// HasHostMetrics returns a boolean if a field has been set. +func (o *InstanceHost) HasHostMetrics() bool { + if o != nil && !IsNil(o.HostMetrics) { + return true + } + + return false +} + +// SetHostMetrics gets a reference to the given []InstanceHostMetric and assigns it to the HostMetrics field. +func (o *InstanceHost) SetHostMetrics(v []InstanceHostMetric) { + o.HostMetrics = v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *InstanceHost) 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 *InstanceHost) 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 *InstanceHost) 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 *InstanceHost) SetId(v string) { + o.Id = &v +} + +func (o InstanceHost) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceHost) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.HostMetrics) { + toSerialize["hostMetrics"] = o.HostMetrics + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + return toSerialize, nil +} + +type NullableInstanceHost struct { + value *InstanceHost + isSet bool +} + +func (v NullableInstanceHost) Get() *InstanceHost { + return v.value +} + +func (v *NullableInstanceHost) Set(val *InstanceHost) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceHost) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceHost) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceHost(val *InstanceHost) *NullableInstanceHost { + return &NullableInstanceHost{value: val, isSet: true} +} + +func (v NullableInstanceHost) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceHost) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_instance_host_metric.go b/services/postgresflex/v2api/model_instance_host_metric.go new file mode 100644 index 000000000..008129917 --- /dev/null +++ b/services/postgresflex/v2api/model_instance_host_metric.go @@ -0,0 +1,197 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the InstanceHostMetric type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceHostMetric{} + +// InstanceHostMetric struct for InstanceHostMetric +type InstanceHostMetric struct { + Datapoints []InstanceDataPoint `json:"datapoints,omitempty"` + Name *string `json:"name,omitempty"` + Units *string `json:"units,omitempty"` +} + +// NewInstanceHostMetric instantiates a new InstanceHostMetric object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceHostMetric() *InstanceHostMetric { + this := InstanceHostMetric{} + return &this +} + +// NewInstanceHostMetricWithDefaults instantiates a new InstanceHostMetric object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceHostMetricWithDefaults() *InstanceHostMetric { + this := InstanceHostMetric{} + return &this +} + +// GetDatapoints returns the Datapoints field value if set, zero value otherwise. +func (o *InstanceHostMetric) GetDatapoints() []InstanceDataPoint { + if o == nil || IsNil(o.Datapoints) { + var ret []InstanceDataPoint + return ret + } + return o.Datapoints +} + +// GetDatapointsOk returns a tuple with the Datapoints field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceHostMetric) GetDatapointsOk() ([]InstanceDataPoint, bool) { + if o == nil || IsNil(o.Datapoints) { + return nil, false + } + return o.Datapoints, true +} + +// HasDatapoints returns a boolean if a field has been set. +func (o *InstanceHostMetric) HasDatapoints() bool { + if o != nil && !IsNil(o.Datapoints) { + return true + } + + return false +} + +// SetDatapoints gets a reference to the given []InstanceDataPoint and assigns it to the Datapoints field. +func (o *InstanceHostMetric) SetDatapoints(v []InstanceDataPoint) { + o.Datapoints = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *InstanceHostMetric) 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 *InstanceHostMetric) 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 *InstanceHostMetric) 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 *InstanceHostMetric) SetName(v string) { + o.Name = &v +} + +// GetUnits returns the Units field value if set, zero value otherwise. +func (o *InstanceHostMetric) GetUnits() string { + if o == nil || IsNil(o.Units) { + var ret string + return ret + } + return *o.Units +} + +// GetUnitsOk returns a tuple with the Units field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceHostMetric) GetUnitsOk() (*string, bool) { + if o == nil || IsNil(o.Units) { + return nil, false + } + return o.Units, true +} + +// HasUnits returns a boolean if a field has been set. +func (o *InstanceHostMetric) HasUnits() bool { + if o != nil && !IsNil(o.Units) { + return true + } + + return false +} + +// SetUnits gets a reference to the given string and assigns it to the Units field. +func (o *InstanceHostMetric) SetUnits(v string) { + o.Units = &v +} + +func (o InstanceHostMetric) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceHostMetric) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Datapoints) { + toSerialize["datapoints"] = o.Datapoints + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Units) { + toSerialize["units"] = o.Units + } + return toSerialize, nil +} + +type NullableInstanceHostMetric struct { + value *InstanceHostMetric + isSet bool +} + +func (v NullableInstanceHostMetric) Get() *InstanceHostMetric { + return v.value +} + +func (v *NullableInstanceHostMetric) Set(val *InstanceHostMetric) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceHostMetric) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceHostMetric) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceHostMetric(val *InstanceHostMetric) *NullableInstanceHostMetric { + return &NullableInstanceHostMetric{value: val, isSet: true} +} + +func (v NullableInstanceHostMetric) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceHostMetric) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_instance_list_databases_response.go b/services/postgresflex/v2api/model_instance_list_databases_response.go new file mode 100644 index 000000000..a79fe2c22 --- /dev/null +++ b/services/postgresflex/v2api/model_instance_list_databases_response.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the InstanceListDatabasesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceListDatabasesResponse{} + +// InstanceListDatabasesResponse struct for InstanceListDatabasesResponse +type InstanceListDatabasesResponse struct { + Databases []InstanceDatabase `json:"databases,omitempty"` +} + +// NewInstanceListDatabasesResponse instantiates a new InstanceListDatabasesResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceListDatabasesResponse() *InstanceListDatabasesResponse { + this := InstanceListDatabasesResponse{} + return &this +} + +// NewInstanceListDatabasesResponseWithDefaults instantiates a new InstanceListDatabasesResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceListDatabasesResponseWithDefaults() *InstanceListDatabasesResponse { + this := InstanceListDatabasesResponse{} + return &this +} + +// GetDatabases returns the Databases field value if set, zero value otherwise. +func (o *InstanceListDatabasesResponse) GetDatabases() []InstanceDatabase { + if o == nil || IsNil(o.Databases) { + var ret []InstanceDatabase + return ret + } + return o.Databases +} + +// GetDatabasesOk returns a tuple with the Databases field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceListDatabasesResponse) GetDatabasesOk() ([]InstanceDatabase, bool) { + if o == nil || IsNil(o.Databases) { + return nil, false + } + return o.Databases, true +} + +// HasDatabases returns a boolean if a field has been set. +func (o *InstanceListDatabasesResponse) HasDatabases() bool { + if o != nil && !IsNil(o.Databases) { + return true + } + + return false +} + +// SetDatabases gets a reference to the given []InstanceDatabase and assigns it to the Databases field. +func (o *InstanceListDatabasesResponse) SetDatabases(v []InstanceDatabase) { + o.Databases = v +} + +func (o InstanceListDatabasesResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceListDatabasesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Databases) { + toSerialize["databases"] = o.Databases + } + return toSerialize, nil +} + +type NullableInstanceListDatabasesResponse struct { + value *InstanceListDatabasesResponse + isSet bool +} + +func (v NullableInstanceListDatabasesResponse) Get() *InstanceListDatabasesResponse { + return v.value +} + +func (v *NullableInstanceListDatabasesResponse) Set(val *InstanceListDatabasesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceListDatabasesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceListDatabasesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceListDatabasesResponse(val *InstanceListDatabasesResponse) *NullableInstanceListDatabasesResponse { + return &NullableInstanceListDatabasesResponse{value: val, isSet: true} +} + +func (v NullableInstanceListDatabasesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceListDatabasesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_instance_list_instance.go b/services/postgresflex/v2api/model_instance_list_instance.go new file mode 100644 index 000000000..4502bc8d8 --- /dev/null +++ b/services/postgresflex/v2api/model_instance_list_instance.go @@ -0,0 +1,197 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the InstanceListInstance type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceListInstance{} + +// InstanceListInstance struct for InstanceListInstance +type InstanceListInstance struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Status *string `json:"status,omitempty"` +} + +// NewInstanceListInstance instantiates a new InstanceListInstance object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceListInstance() *InstanceListInstance { + this := InstanceListInstance{} + return &this +} + +// NewInstanceListInstanceWithDefaults instantiates a new InstanceListInstance object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceListInstanceWithDefaults() *InstanceListInstance { + this := InstanceListInstance{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *InstanceListInstance) 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 *InstanceListInstance) 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 *InstanceListInstance) 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 *InstanceListInstance) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *InstanceListInstance) 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 *InstanceListInstance) 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 *InstanceListInstance) 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 *InstanceListInstance) SetName(v string) { + o.Name = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *InstanceListInstance) 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 *InstanceListInstance) 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 *InstanceListInstance) 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 *InstanceListInstance) SetStatus(v string) { + o.Status = &v +} + +func (o InstanceListInstance) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceListInstance) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + return toSerialize, nil +} + +type NullableInstanceListInstance struct { + value *InstanceListInstance + isSet bool +} + +func (v NullableInstanceListInstance) Get() *InstanceListInstance { + return v.value +} + +func (v *NullableInstanceListInstance) Set(val *InstanceListInstance) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceListInstance) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceListInstance) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceListInstance(val *InstanceListInstance) *NullableInstanceListInstance { + return &NullableInstanceListInstance{value: val, isSet: true} +} + +func (v NullableInstanceListInstance) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceListInstance) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_instance_metrics_response.go b/services/postgresflex/v2api/model_instance_metrics_response.go new file mode 100644 index 000000000..c2bb25e21 --- /dev/null +++ b/services/postgresflex/v2api/model_instance_metrics_response.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the InstanceMetricsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceMetricsResponse{} + +// InstanceMetricsResponse struct for InstanceMetricsResponse +type InstanceMetricsResponse struct { + Hosts []InstanceHost `json:"hosts,omitempty"` +} + +// NewInstanceMetricsResponse instantiates a new InstanceMetricsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceMetricsResponse() *InstanceMetricsResponse { + this := InstanceMetricsResponse{} + return &this +} + +// NewInstanceMetricsResponseWithDefaults instantiates a new InstanceMetricsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceMetricsResponseWithDefaults() *InstanceMetricsResponse { + this := InstanceMetricsResponse{} + return &this +} + +// GetHosts returns the Hosts field value if set, zero value otherwise. +func (o *InstanceMetricsResponse) GetHosts() []InstanceHost { + if o == nil || IsNil(o.Hosts) { + var ret []InstanceHost + return ret + } + return o.Hosts +} + +// GetHostsOk returns a tuple with the Hosts field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceMetricsResponse) GetHostsOk() ([]InstanceHost, bool) { + if o == nil || IsNil(o.Hosts) { + return nil, false + } + return o.Hosts, true +} + +// HasHosts returns a boolean if a field has been set. +func (o *InstanceMetricsResponse) HasHosts() bool { + if o != nil && !IsNil(o.Hosts) { + return true + } + + return false +} + +// SetHosts gets a reference to the given []InstanceHost and assigns it to the Hosts field. +func (o *InstanceMetricsResponse) SetHosts(v []InstanceHost) { + o.Hosts = v +} + +func (o InstanceMetricsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceMetricsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Hosts) { + toSerialize["hosts"] = o.Hosts + } + return toSerialize, nil +} + +type NullableInstanceMetricsResponse struct { + value *InstanceMetricsResponse + isSet bool +} + +func (v NullableInstanceMetricsResponse) Get() *InstanceMetricsResponse { + return v.value +} + +func (v *NullableInstanceMetricsResponse) Set(val *InstanceMetricsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceMetricsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceMetricsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceMetricsResponse(val *InstanceMetricsResponse) *NullableInstanceMetricsResponse { + return &NullableInstanceMetricsResponse{value: val, isSet: true} +} + +func (v NullableInstanceMetricsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceMetricsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_instance_response.go b/services/postgresflex/v2api/model_instance_response.go new file mode 100644 index 000000000..73a95b2d2 --- /dev/null +++ b/services/postgresflex/v2api/model_instance_response.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the InstanceResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceResponse{} + +// InstanceResponse struct for InstanceResponse +type InstanceResponse struct { + Item *Instance `json:"item,omitempty"` +} + +// NewInstanceResponse instantiates a new InstanceResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceResponse() *InstanceResponse { + this := InstanceResponse{} + return &this +} + +// NewInstanceResponseWithDefaults instantiates a new InstanceResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceResponseWithDefaults() *InstanceResponse { + this := InstanceResponse{} + return &this +} + +// GetItem returns the Item field value if set, zero value otherwise. +func (o *InstanceResponse) GetItem() Instance { + if o == nil || IsNil(o.Item) { + var ret Instance + return ret + } + return *o.Item +} + +// GetItemOk returns a tuple with the Item field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceResponse) GetItemOk() (*Instance, bool) { + if o == nil || IsNil(o.Item) { + return nil, false + } + return o.Item, true +} + +// HasItem returns a boolean if a field has been set. +func (o *InstanceResponse) HasItem() bool { + if o != nil && !IsNil(o.Item) { + return true + } + + return false +} + +// SetItem gets a reference to the given Instance and assigns it to the Item field. +func (o *InstanceResponse) SetItem(v Instance) { + o.Item = &v +} + +func (o InstanceResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Item) { + toSerialize["item"] = o.Item + } + return toSerialize, nil +} + +type NullableInstanceResponse struct { + value *InstanceResponse + isSet bool +} + +func (v NullableInstanceResponse) Get() *InstanceResponse { + return v.value +} + +func (v *NullableInstanceResponse) Set(val *InstanceResponse) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceResponse(val *InstanceResponse) *NullableInstanceResponse { + return &NullableInstanceResponse{value: val, isSet: true} +} + +func (v NullableInstanceResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_list_backups_response.go b/services/postgresflex/v2api/model_list_backups_response.go new file mode 100644 index 000000000..3a99ba1df --- /dev/null +++ b/services/postgresflex/v2api/model_list_backups_response.go @@ -0,0 +1,161 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the ListBackupsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListBackupsResponse{} + +// ListBackupsResponse struct for ListBackupsResponse +type ListBackupsResponse struct { + Count *int64 `json:"count,omitempty"` + Items []Backup `json:"items,omitempty"` +} + +// NewListBackupsResponse instantiates a new ListBackupsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListBackupsResponse() *ListBackupsResponse { + this := ListBackupsResponse{} + return &this +} + +// NewListBackupsResponseWithDefaults instantiates a new ListBackupsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListBackupsResponseWithDefaults() *ListBackupsResponse { + this := ListBackupsResponse{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *ListBackupsResponse) GetCount() int64 { + if o == nil || IsNil(o.Count) { + var ret int64 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListBackupsResponse) GetCountOk() (*int64, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *ListBackupsResponse) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int64 and assigns it to the Count field. +func (o *ListBackupsResponse) SetCount(v int64) { + o.Count = &v +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *ListBackupsResponse) GetItems() []Backup { + if o == nil || IsNil(o.Items) { + var ret []Backup + return ret + } + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListBackupsResponse) GetItemsOk() ([]Backup, bool) { + if o == nil || IsNil(o.Items) { + return nil, false + } + return o.Items, true +} + +// HasItems returns a boolean if a field has been set. +func (o *ListBackupsResponse) HasItems() bool { + if o != nil && !IsNil(o.Items) { + return true + } + + return false +} + +// SetItems gets a reference to the given []Backup and assigns it to the Items field. +func (o *ListBackupsResponse) SetItems(v []Backup) { + o.Items = v +} + +func (o ListBackupsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListBackupsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if !IsNil(o.Items) { + toSerialize["items"] = o.Items + } + return toSerialize, nil +} + +type NullableListBackupsResponse struct { + value *ListBackupsResponse + isSet bool +} + +func (v NullableListBackupsResponse) Get() *ListBackupsResponse { + return v.value +} + +func (v *NullableListBackupsResponse) Set(val *ListBackupsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListBackupsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListBackupsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListBackupsResponse(val *ListBackupsResponse) *NullableListBackupsResponse { + return &NullableListBackupsResponse{value: val, isSet: true} +} + +func (v NullableListBackupsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListBackupsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_list_flavors_response.go b/services/postgresflex/v2api/model_list_flavors_response.go new file mode 100644 index 000000000..80cc2fca0 --- /dev/null +++ b/services/postgresflex/v2api/model_list_flavors_response.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the ListFlavorsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListFlavorsResponse{} + +// ListFlavorsResponse struct for ListFlavorsResponse +type ListFlavorsResponse struct { + Flavors []Flavor `json:"flavors,omitempty"` +} + +// NewListFlavorsResponse instantiates a new ListFlavorsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListFlavorsResponse() *ListFlavorsResponse { + this := ListFlavorsResponse{} + return &this +} + +// NewListFlavorsResponseWithDefaults instantiates a new ListFlavorsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListFlavorsResponseWithDefaults() *ListFlavorsResponse { + this := ListFlavorsResponse{} + return &this +} + +// GetFlavors returns the Flavors field value if set, zero value otherwise. +func (o *ListFlavorsResponse) GetFlavors() []Flavor { + if o == nil || IsNil(o.Flavors) { + var ret []Flavor + return ret + } + return o.Flavors +} + +// GetFlavorsOk returns a tuple with the Flavors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListFlavorsResponse) GetFlavorsOk() ([]Flavor, bool) { + if o == nil || IsNil(o.Flavors) { + return nil, false + } + return o.Flavors, true +} + +// HasFlavors returns a boolean if a field has been set. +func (o *ListFlavorsResponse) HasFlavors() bool { + if o != nil && !IsNil(o.Flavors) { + return true + } + + return false +} + +// SetFlavors gets a reference to the given []Flavor and assigns it to the Flavors field. +func (o *ListFlavorsResponse) SetFlavors(v []Flavor) { + o.Flavors = v +} + +func (o ListFlavorsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListFlavorsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Flavors) { + toSerialize["flavors"] = o.Flavors + } + return toSerialize, nil +} + +type NullableListFlavorsResponse struct { + value *ListFlavorsResponse + isSet bool +} + +func (v NullableListFlavorsResponse) Get() *ListFlavorsResponse { + return v.value +} + +func (v *NullableListFlavorsResponse) Set(val *ListFlavorsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListFlavorsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListFlavorsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListFlavorsResponse(val *ListFlavorsResponse) *NullableListFlavorsResponse { + return &NullableListFlavorsResponse{value: val, isSet: true} +} + +func (v NullableListFlavorsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListFlavorsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_list_instances_response.go b/services/postgresflex/v2api/model_list_instances_response.go new file mode 100644 index 000000000..b2e0f46c1 --- /dev/null +++ b/services/postgresflex/v2api/model_list_instances_response.go @@ -0,0 +1,161 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the ListInstancesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListInstancesResponse{} + +// ListInstancesResponse struct for ListInstancesResponse +type ListInstancesResponse struct { + Count *int64 `json:"count,omitempty"` + Items []InstanceListInstance `json:"items,omitempty"` +} + +// NewListInstancesResponse instantiates a new ListInstancesResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListInstancesResponse() *ListInstancesResponse { + this := ListInstancesResponse{} + return &this +} + +// NewListInstancesResponseWithDefaults instantiates a new ListInstancesResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListInstancesResponseWithDefaults() *ListInstancesResponse { + this := ListInstancesResponse{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *ListInstancesResponse) GetCount() int64 { + if o == nil || IsNil(o.Count) { + var ret int64 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListInstancesResponse) GetCountOk() (*int64, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *ListInstancesResponse) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int64 and assigns it to the Count field. +func (o *ListInstancesResponse) SetCount(v int64) { + o.Count = &v +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *ListInstancesResponse) GetItems() []InstanceListInstance { + if o == nil || IsNil(o.Items) { + var ret []InstanceListInstance + return ret + } + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListInstancesResponse) GetItemsOk() ([]InstanceListInstance, bool) { + if o == nil || IsNil(o.Items) { + return nil, false + } + return o.Items, true +} + +// HasItems returns a boolean if a field has been set. +func (o *ListInstancesResponse) HasItems() bool { + if o != nil && !IsNil(o.Items) { + return true + } + + return false +} + +// SetItems gets a reference to the given []InstanceListInstance and assigns it to the Items field. +func (o *ListInstancesResponse) SetItems(v []InstanceListInstance) { + o.Items = v +} + +func (o ListInstancesResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListInstancesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if !IsNil(o.Items) { + toSerialize["items"] = o.Items + } + return toSerialize, nil +} + +type NullableListInstancesResponse struct { + value *ListInstancesResponse + isSet bool +} + +func (v NullableListInstancesResponse) Get() *ListInstancesResponse { + return v.value +} + +func (v *NullableListInstancesResponse) Set(val *ListInstancesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListInstancesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListInstancesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListInstancesResponse(val *ListInstancesResponse) *NullableListInstancesResponse { + return &NullableListInstancesResponse{value: val, isSet: true} +} + +func (v NullableListInstancesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListInstancesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_list_storages_response.go b/services/postgresflex/v2api/model_list_storages_response.go new file mode 100644 index 000000000..f9d48a6f3 --- /dev/null +++ b/services/postgresflex/v2api/model_list_storages_response.go @@ -0,0 +1,161 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the ListStoragesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListStoragesResponse{} + +// ListStoragesResponse struct for ListStoragesResponse +type ListStoragesResponse struct { + StorageClasses []string `json:"storageClasses,omitempty"` + StorageRange *StorageRange `json:"storageRange,omitempty"` +} + +// NewListStoragesResponse instantiates a new ListStoragesResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListStoragesResponse() *ListStoragesResponse { + this := ListStoragesResponse{} + return &this +} + +// NewListStoragesResponseWithDefaults instantiates a new ListStoragesResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListStoragesResponseWithDefaults() *ListStoragesResponse { + this := ListStoragesResponse{} + return &this +} + +// GetStorageClasses returns the StorageClasses field value if set, zero value otherwise. +func (o *ListStoragesResponse) GetStorageClasses() []string { + if o == nil || IsNil(o.StorageClasses) { + var ret []string + return ret + } + return o.StorageClasses +} + +// GetStorageClassesOk returns a tuple with the StorageClasses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListStoragesResponse) GetStorageClassesOk() ([]string, bool) { + if o == nil || IsNil(o.StorageClasses) { + return nil, false + } + return o.StorageClasses, true +} + +// HasStorageClasses returns a boolean if a field has been set. +func (o *ListStoragesResponse) HasStorageClasses() bool { + if o != nil && !IsNil(o.StorageClasses) { + return true + } + + return false +} + +// SetStorageClasses gets a reference to the given []string and assigns it to the StorageClasses field. +func (o *ListStoragesResponse) SetStorageClasses(v []string) { + o.StorageClasses = v +} + +// GetStorageRange returns the StorageRange field value if set, zero value otherwise. +func (o *ListStoragesResponse) GetStorageRange() StorageRange { + if o == nil || IsNil(o.StorageRange) { + var ret StorageRange + return ret + } + return *o.StorageRange +} + +// GetStorageRangeOk returns a tuple with the StorageRange field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListStoragesResponse) GetStorageRangeOk() (*StorageRange, bool) { + if o == nil || IsNil(o.StorageRange) { + return nil, false + } + return o.StorageRange, true +} + +// HasStorageRange returns a boolean if a field has been set. +func (o *ListStoragesResponse) HasStorageRange() bool { + if o != nil && !IsNil(o.StorageRange) { + return true + } + + return false +} + +// SetStorageRange gets a reference to the given StorageRange and assigns it to the StorageRange field. +func (o *ListStoragesResponse) SetStorageRange(v StorageRange) { + o.StorageRange = &v +} + +func (o ListStoragesResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListStoragesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.StorageClasses) { + toSerialize["storageClasses"] = o.StorageClasses + } + if !IsNil(o.StorageRange) { + toSerialize["storageRange"] = o.StorageRange + } + return toSerialize, nil +} + +type NullableListStoragesResponse struct { + value *ListStoragesResponse + isSet bool +} + +func (v NullableListStoragesResponse) Get() *ListStoragesResponse { + return v.value +} + +func (v *NullableListStoragesResponse) Set(val *ListStoragesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListStoragesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListStoragesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListStoragesResponse(val *ListStoragesResponse) *NullableListStoragesResponse { + return &NullableListStoragesResponse{value: val, isSet: true} +} + +func (v NullableListStoragesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListStoragesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_list_users_response.go b/services/postgresflex/v2api/model_list_users_response.go new file mode 100644 index 000000000..b24155fb7 --- /dev/null +++ b/services/postgresflex/v2api/model_list_users_response.go @@ -0,0 +1,161 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the ListUsersResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListUsersResponse{} + +// ListUsersResponse struct for ListUsersResponse +type ListUsersResponse struct { + Count *int64 `json:"count,omitempty"` + Items []ListUsersResponseItem `json:"items,omitempty"` +} + +// NewListUsersResponse instantiates a new ListUsersResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListUsersResponse() *ListUsersResponse { + this := ListUsersResponse{} + return &this +} + +// NewListUsersResponseWithDefaults instantiates a new ListUsersResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListUsersResponseWithDefaults() *ListUsersResponse { + this := ListUsersResponse{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *ListUsersResponse) GetCount() int64 { + if o == nil || IsNil(o.Count) { + var ret int64 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListUsersResponse) GetCountOk() (*int64, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *ListUsersResponse) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int64 and assigns it to the Count field. +func (o *ListUsersResponse) SetCount(v int64) { + o.Count = &v +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *ListUsersResponse) GetItems() []ListUsersResponseItem { + if o == nil || IsNil(o.Items) { + var ret []ListUsersResponseItem + return ret + } + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListUsersResponse) GetItemsOk() ([]ListUsersResponseItem, bool) { + if o == nil || IsNil(o.Items) { + return nil, false + } + return o.Items, true +} + +// HasItems returns a boolean if a field has been set. +func (o *ListUsersResponse) HasItems() bool { + if o != nil && !IsNil(o.Items) { + return true + } + + return false +} + +// SetItems gets a reference to the given []ListUsersResponseItem and assigns it to the Items field. +func (o *ListUsersResponse) SetItems(v []ListUsersResponseItem) { + o.Items = v +} + +func (o ListUsersResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListUsersResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if !IsNil(o.Items) { + toSerialize["items"] = o.Items + } + return toSerialize, nil +} + +type NullableListUsersResponse struct { + value *ListUsersResponse + isSet bool +} + +func (v NullableListUsersResponse) Get() *ListUsersResponse { + return v.value +} + +func (v *NullableListUsersResponse) Set(val *ListUsersResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListUsersResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListUsersResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListUsersResponse(val *ListUsersResponse) *NullableListUsersResponse { + return &NullableListUsersResponse{value: val, isSet: true} +} + +func (v NullableListUsersResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListUsersResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_list_users_response_item.go b/services/postgresflex/v2api/model_list_users_response_item.go new file mode 100644 index 000000000..d99ed52ce --- /dev/null +++ b/services/postgresflex/v2api/model_list_users_response_item.go @@ -0,0 +1,161 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the ListUsersResponseItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListUsersResponseItem{} + +// ListUsersResponseItem struct for ListUsersResponseItem +type ListUsersResponseItem struct { + Id *string `json:"id,omitempty"` + Username *string `json:"username,omitempty"` +} + +// NewListUsersResponseItem instantiates a new ListUsersResponseItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListUsersResponseItem() *ListUsersResponseItem { + this := ListUsersResponseItem{} + return &this +} + +// NewListUsersResponseItemWithDefaults instantiates a new ListUsersResponseItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListUsersResponseItemWithDefaults() *ListUsersResponseItem { + this := ListUsersResponseItem{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *ListUsersResponseItem) 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 *ListUsersResponseItem) 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 *ListUsersResponseItem) 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 *ListUsersResponseItem) SetId(v string) { + o.Id = &v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *ListUsersResponseItem) GetUsername() string { + if o == nil || IsNil(o.Username) { + var ret string + return ret + } + return *o.Username +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListUsersResponseItem) GetUsernameOk() (*string, bool) { + if o == nil || IsNil(o.Username) { + return nil, false + } + return o.Username, true +} + +// HasUsername returns a boolean if a field has been set. +func (o *ListUsersResponseItem) HasUsername() bool { + if o != nil && !IsNil(o.Username) { + return true + } + + return false +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *ListUsersResponseItem) SetUsername(v string) { + o.Username = &v +} + +func (o ListUsersResponseItem) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListUsersResponseItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Username) { + toSerialize["username"] = o.Username + } + return toSerialize, nil +} + +type NullableListUsersResponseItem struct { + value *ListUsersResponseItem + isSet bool +} + +func (v NullableListUsersResponseItem) Get() *ListUsersResponseItem { + return v.value +} + +func (v *NullableListUsersResponseItem) Set(val *ListUsersResponseItem) { + v.value = val + v.isSet = true +} + +func (v NullableListUsersResponseItem) IsSet() bool { + return v.isSet +} + +func (v *NullableListUsersResponseItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListUsersResponseItem(val *ListUsersResponseItem) *NullableListUsersResponseItem { + return &NullableListUsersResponseItem{value: val, isSet: true} +} + +func (v NullableListUsersResponseItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListUsersResponseItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_list_versions_response.go b/services/postgresflex/v2api/model_list_versions_response.go new file mode 100644 index 000000000..79c88d4a5 --- /dev/null +++ b/services/postgresflex/v2api/model_list_versions_response.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the ListVersionsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListVersionsResponse{} + +// ListVersionsResponse struct for ListVersionsResponse +type ListVersionsResponse struct { + Versions []string `json:"versions,omitempty"` +} + +// NewListVersionsResponse instantiates a new ListVersionsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListVersionsResponse() *ListVersionsResponse { + this := ListVersionsResponse{} + return &this +} + +// NewListVersionsResponseWithDefaults instantiates a new ListVersionsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListVersionsResponseWithDefaults() *ListVersionsResponse { + this := ListVersionsResponse{} + return &this +} + +// GetVersions returns the Versions field value if set, zero value otherwise. +func (o *ListVersionsResponse) GetVersions() []string { + if o == nil || IsNil(o.Versions) { + var ret []string + return ret + } + return o.Versions +} + +// GetVersionsOk returns a tuple with the Versions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListVersionsResponse) GetVersionsOk() ([]string, bool) { + if o == nil || IsNil(o.Versions) { + return nil, false + } + return o.Versions, true +} + +// HasVersions returns a boolean if a field has been set. +func (o *ListVersionsResponse) HasVersions() bool { + if o != nil && !IsNil(o.Versions) { + return true + } + + return false +} + +// SetVersions gets a reference to the given []string and assigns it to the Versions field. +func (o *ListVersionsResponse) SetVersions(v []string) { + o.Versions = v +} + +func (o ListVersionsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListVersionsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Versions) { + toSerialize["versions"] = o.Versions + } + return toSerialize, nil +} + +type NullableListVersionsResponse struct { + value *ListVersionsResponse + isSet bool +} + +func (v NullableListVersionsResponse) Get() *ListVersionsResponse { + return v.value +} + +func (v *NullableListVersionsResponse) Set(val *ListVersionsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListVersionsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListVersionsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListVersionsResponse(val *ListVersionsResponse) *NullableListVersionsResponse { + return &NullableListVersionsResponse{value: val, isSet: true} +} + +func (v NullableListVersionsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListVersionsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_partial_update_instance_payload.go b/services/postgresflex/v2api/model_partial_update_instance_payload.go new file mode 100644 index 000000000..5819554b9 --- /dev/null +++ b/services/postgresflex/v2api/model_partial_update_instance_payload.go @@ -0,0 +1,414 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the PartialUpdateInstancePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateInstancePayload{} + +// PartialUpdateInstancePayload struct for PartialUpdateInstancePayload +type PartialUpdateInstancePayload struct { + Acl *ACL `json:"acl,omitempty"` + BackupSchedule *string `json:"backupSchedule,omitempty"` + FlavorId *string `json:"flavorId,omitempty"` + // Labels field is not certain/clear + Labels *map[string]string `json:"labels,omitempty"` + Name *string `json:"name,omitempty"` + Options *map[string]string `json:"options,omitempty"` + Replicas *int32 `json:"replicas,omitempty"` + Storage *StorageUpdate `json:"storage,omitempty"` + Version *string `json:"version,omitempty"` +} + +// NewPartialUpdateInstancePayload instantiates a new PartialUpdateInstancePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPartialUpdateInstancePayload() *PartialUpdateInstancePayload { + this := PartialUpdateInstancePayload{} + return &this +} + +// NewPartialUpdateInstancePayloadWithDefaults instantiates a new PartialUpdateInstancePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPartialUpdateInstancePayloadWithDefaults() *PartialUpdateInstancePayload { + this := PartialUpdateInstancePayload{} + return &this +} + +// GetAcl returns the Acl field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetAcl() ACL { + if o == nil || IsNil(o.Acl) { + var ret ACL + return ret + } + return *o.Acl +} + +// GetAclOk returns a tuple with the Acl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetAclOk() (*ACL, bool) { + if o == nil || IsNil(o.Acl) { + return nil, false + } + return o.Acl, true +} + +// HasAcl returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasAcl() bool { + if o != nil && !IsNil(o.Acl) { + return true + } + + return false +} + +// SetAcl gets a reference to the given ACL and assigns it to the Acl field. +func (o *PartialUpdateInstancePayload) SetAcl(v ACL) { + o.Acl = &v +} + +// GetBackupSchedule returns the BackupSchedule field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetBackupSchedule() string { + if o == nil || IsNil(o.BackupSchedule) { + var ret string + return ret + } + return *o.BackupSchedule +} + +// GetBackupScheduleOk returns a tuple with the BackupSchedule field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetBackupScheduleOk() (*string, bool) { + if o == nil || IsNil(o.BackupSchedule) { + return nil, false + } + return o.BackupSchedule, true +} + +// HasBackupSchedule returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasBackupSchedule() bool { + if o != nil && !IsNil(o.BackupSchedule) { + return true + } + + return false +} + +// SetBackupSchedule gets a reference to the given string and assigns it to the BackupSchedule field. +func (o *PartialUpdateInstancePayload) SetBackupSchedule(v string) { + o.BackupSchedule = &v +} + +// GetFlavorId returns the FlavorId field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetFlavorId() string { + if o == nil || IsNil(o.FlavorId) { + var ret string + return ret + } + return *o.FlavorId +} + +// GetFlavorIdOk returns a tuple with the FlavorId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetFlavorIdOk() (*string, bool) { + if o == nil || IsNil(o.FlavorId) { + return nil, false + } + return o.FlavorId, true +} + +// HasFlavorId returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasFlavorId() bool { + if o != nil && !IsNil(o.FlavorId) { + return true + } + + return false +} + +// SetFlavorId gets a reference to the given string and assigns it to the FlavorId field. +func (o *PartialUpdateInstancePayload) SetFlavorId(v string) { + o.FlavorId = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetLabels() map[string]string { + if o == nil || IsNil(o.Labels) { + var ret map[string]string + 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 *PartialUpdateInstancePayload) GetLabelsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Labels) { + return nil, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *PartialUpdateInstancePayload) SetLabels(v map[string]string) { + o.Labels = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) 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 *PartialUpdateInstancePayload) 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 *PartialUpdateInstancePayload) 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 *PartialUpdateInstancePayload) SetName(v string) { + o.Name = &v +} + +// GetOptions returns the Options field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetOptions() map[string]string { + if o == nil || IsNil(o.Options) { + var ret map[string]string + return ret + } + return *o.Options +} + +// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetOptionsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Options) { + return nil, false + } + return o.Options, true +} + +// HasOptions returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasOptions() bool { + if o != nil && !IsNil(o.Options) { + return true + } + + return false +} + +// SetOptions gets a reference to the given map[string]string and assigns it to the Options field. +func (o *PartialUpdateInstancePayload) SetOptions(v map[string]string) { + o.Options = &v +} + +// GetReplicas returns the Replicas field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetReplicas() int32 { + if o == nil || IsNil(o.Replicas) { + var ret int32 + return ret + } + return *o.Replicas +} + +// GetReplicasOk returns a tuple with the Replicas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetReplicasOk() (*int32, bool) { + if o == nil || IsNil(o.Replicas) { + return nil, false + } + return o.Replicas, true +} + +// HasReplicas returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasReplicas() bool { + if o != nil && !IsNil(o.Replicas) { + return true + } + + return false +} + +// SetReplicas gets a reference to the given int32 and assigns it to the Replicas field. +func (o *PartialUpdateInstancePayload) SetReplicas(v int32) { + o.Replicas = &v +} + +// GetStorage returns the Storage field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetStorage() StorageUpdate { + if o == nil || IsNil(o.Storage) { + var ret StorageUpdate + return ret + } + return *o.Storage +} + +// GetStorageOk returns a tuple with the Storage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetStorageOk() (*StorageUpdate, bool) { + if o == nil || IsNil(o.Storage) { + return nil, false + } + return o.Storage, true +} + +// HasStorage returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasStorage() bool { + if o != nil && !IsNil(o.Storage) { + return true + } + + return false +} + +// SetStorage gets a reference to the given StorageUpdate and assigns it to the Storage field. +func (o *PartialUpdateInstancePayload) SetStorage(v StorageUpdate) { + o.Storage = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetVersion() string { + if o == nil || IsNil(o.Version) { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetVersionOk() (*string, bool) { + if o == nil || IsNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasVersion() bool { + if o != nil && !IsNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *PartialUpdateInstancePayload) SetVersion(v string) { + o.Version = &v +} + +func (o PartialUpdateInstancePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PartialUpdateInstancePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Acl) { + toSerialize["acl"] = o.Acl + } + if !IsNil(o.BackupSchedule) { + toSerialize["backupSchedule"] = o.BackupSchedule + } + if !IsNil(o.FlavorId) { + toSerialize["flavorId"] = o.FlavorId + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Options) { + toSerialize["options"] = o.Options + } + if !IsNil(o.Replicas) { + toSerialize["replicas"] = o.Replicas + } + if !IsNil(o.Storage) { + toSerialize["storage"] = o.Storage + } + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + return toSerialize, nil +} + +type NullablePartialUpdateInstancePayload struct { + value *PartialUpdateInstancePayload + isSet bool +} + +func (v NullablePartialUpdateInstancePayload) Get() *PartialUpdateInstancePayload { + return v.value +} + +func (v *NullablePartialUpdateInstancePayload) Set(val *PartialUpdateInstancePayload) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateInstancePayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateInstancePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateInstancePayload(val *PartialUpdateInstancePayload) *NullablePartialUpdateInstancePayload { + return &NullablePartialUpdateInstancePayload{value: val, isSet: true} +} + +func (v NullablePartialUpdateInstancePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateInstancePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_partial_update_instance_response.go b/services/postgresflex/v2api/model_partial_update_instance_response.go new file mode 100644 index 000000000..42b9ccaf0 --- /dev/null +++ b/services/postgresflex/v2api/model_partial_update_instance_response.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the PartialUpdateInstanceResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateInstanceResponse{} + +// PartialUpdateInstanceResponse struct for PartialUpdateInstanceResponse +type PartialUpdateInstanceResponse struct { + Item *Instance `json:"item,omitempty"` +} + +// NewPartialUpdateInstanceResponse instantiates a new PartialUpdateInstanceResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPartialUpdateInstanceResponse() *PartialUpdateInstanceResponse { + this := PartialUpdateInstanceResponse{} + return &this +} + +// NewPartialUpdateInstanceResponseWithDefaults instantiates a new PartialUpdateInstanceResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPartialUpdateInstanceResponseWithDefaults() *PartialUpdateInstanceResponse { + this := PartialUpdateInstanceResponse{} + return &this +} + +// GetItem returns the Item field value if set, zero value otherwise. +func (o *PartialUpdateInstanceResponse) GetItem() Instance { + if o == nil || IsNil(o.Item) { + var ret Instance + return ret + } + return *o.Item +} + +// GetItemOk returns a tuple with the Item field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstanceResponse) GetItemOk() (*Instance, bool) { + if o == nil || IsNil(o.Item) { + return nil, false + } + return o.Item, true +} + +// HasItem returns a boolean if a field has been set. +func (o *PartialUpdateInstanceResponse) HasItem() bool { + if o != nil && !IsNil(o.Item) { + return true + } + + return false +} + +// SetItem gets a reference to the given Instance and assigns it to the Item field. +func (o *PartialUpdateInstanceResponse) SetItem(v Instance) { + o.Item = &v +} + +func (o PartialUpdateInstanceResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PartialUpdateInstanceResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Item) { + toSerialize["item"] = o.Item + } + return toSerialize, nil +} + +type NullablePartialUpdateInstanceResponse struct { + value *PartialUpdateInstanceResponse + isSet bool +} + +func (v NullablePartialUpdateInstanceResponse) Get() *PartialUpdateInstanceResponse { + return v.value +} + +func (v *NullablePartialUpdateInstanceResponse) Set(val *PartialUpdateInstanceResponse) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateInstanceResponse) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateInstanceResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateInstanceResponse(val *PartialUpdateInstanceResponse) *NullablePartialUpdateInstanceResponse { + return &NullablePartialUpdateInstanceResponse{value: val, isSet: true} +} + +func (v NullablePartialUpdateInstanceResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateInstanceResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_partial_update_user_payload.go b/services/postgresflex/v2api/model_partial_update_user_payload.go new file mode 100644 index 000000000..18282253a --- /dev/null +++ b/services/postgresflex/v2api/model_partial_update_user_payload.go @@ -0,0 +1,161 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the PartialUpdateUserPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateUserPayload{} + +// PartialUpdateUserPayload struct for PartialUpdateUserPayload +type PartialUpdateUserPayload struct { + Database *string `json:"database,omitempty"` + Roles []string `json:"roles,omitempty"` +} + +// NewPartialUpdateUserPayload instantiates a new PartialUpdateUserPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPartialUpdateUserPayload() *PartialUpdateUserPayload { + this := PartialUpdateUserPayload{} + return &this +} + +// NewPartialUpdateUserPayloadWithDefaults instantiates a new PartialUpdateUserPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPartialUpdateUserPayloadWithDefaults() *PartialUpdateUserPayload { + this := PartialUpdateUserPayload{} + return &this +} + +// GetDatabase returns the Database field value if set, zero value otherwise. +func (o *PartialUpdateUserPayload) GetDatabase() string { + if o == nil || IsNil(o.Database) { + var ret string + return ret + } + return *o.Database +} + +// GetDatabaseOk returns a tuple with the Database field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateUserPayload) GetDatabaseOk() (*string, bool) { + if o == nil || IsNil(o.Database) { + return nil, false + } + return o.Database, true +} + +// HasDatabase returns a boolean if a field has been set. +func (o *PartialUpdateUserPayload) HasDatabase() bool { + if o != nil && !IsNil(o.Database) { + return true + } + + return false +} + +// SetDatabase gets a reference to the given string and assigns it to the Database field. +func (o *PartialUpdateUserPayload) SetDatabase(v string) { + o.Database = &v +} + +// GetRoles returns the Roles field value if set, zero value otherwise. +func (o *PartialUpdateUserPayload) GetRoles() []string { + if o == nil || IsNil(o.Roles) { + var ret []string + return ret + } + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateUserPayload) GetRolesOk() ([]string, bool) { + if o == nil || IsNil(o.Roles) { + return nil, false + } + return o.Roles, true +} + +// HasRoles returns a boolean if a field has been set. +func (o *PartialUpdateUserPayload) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { + return true + } + + return false +} + +// SetRoles gets a reference to the given []string and assigns it to the Roles field. +func (o *PartialUpdateUserPayload) SetRoles(v []string) { + o.Roles = v +} + +func (o PartialUpdateUserPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PartialUpdateUserPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Database) { + toSerialize["database"] = o.Database + } + if !IsNil(o.Roles) { + toSerialize["roles"] = o.Roles + } + return toSerialize, nil +} + +type NullablePartialUpdateUserPayload struct { + value *PartialUpdateUserPayload + isSet bool +} + +func (v NullablePartialUpdateUserPayload) Get() *PartialUpdateUserPayload { + return v.value +} + +func (v *NullablePartialUpdateUserPayload) Set(val *PartialUpdateUserPayload) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateUserPayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateUserPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateUserPayload(val *PartialUpdateUserPayload) *NullablePartialUpdateUserPayload { + return &NullablePartialUpdateUserPayload{value: val, isSet: true} +} + +func (v NullablePartialUpdateUserPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateUserPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_postgres_database_parameter.go b/services/postgresflex/v2api/model_postgres_database_parameter.go new file mode 100644 index 000000000..66fedf372 --- /dev/null +++ b/services/postgresflex/v2api/model_postgres_database_parameter.go @@ -0,0 +1,533 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the PostgresDatabaseParameter type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PostgresDatabaseParameter{} + +// PostgresDatabaseParameter struct for PostgresDatabaseParameter +type PostgresDatabaseParameter struct { + // Context of the parameter. + Context *string `json:"context,omitempty"` + // Datatype describes the type of data that is used in the Value field. + DataType *string `json:"dataType,omitempty"` + // DefaultValue for the value field. + DefaultValue *string `json:"defaultValue,omitempty"` + // Description of the parameter. + Description *string `json:"description,omitempty"` + // Edit shows if the user can change this value. + Edit *bool `json:"edit,omitempty"` + // MaxValue describes the highest possible value that can be set. + MaxValue *string `json:"maxValue,omitempty"` + // MinValue describes the lowest possible value that can be set. + MinValue *string `json:"minValue,omitempty"` + // Name of the parameter. + Name *string `json:"name,omitempty"` + // PendingRestart describes if a parameter change requires a restart of the server. + PendingRestart *bool `json:"pendingRestart,omitempty"` + // ResetValue for the value field af.ter a reset. + ResetValue *string `json:"resetValue,omitempty"` + // Unit if the parameter has a unit if not empty. + Unit *string `json:"unit,omitempty"` + // Value of this parameter. + Value *string `json:"value,omitempty"` +} + +// NewPostgresDatabaseParameter instantiates a new PostgresDatabaseParameter object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPostgresDatabaseParameter() *PostgresDatabaseParameter { + this := PostgresDatabaseParameter{} + return &this +} + +// NewPostgresDatabaseParameterWithDefaults instantiates a new PostgresDatabaseParameter object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPostgresDatabaseParameterWithDefaults() *PostgresDatabaseParameter { + this := PostgresDatabaseParameter{} + return &this +} + +// GetContext returns the Context field value if set, zero value otherwise. +func (o *PostgresDatabaseParameter) GetContext() string { + if o == nil || IsNil(o.Context) { + var ret string + return ret + } + return *o.Context +} + +// GetContextOk returns a tuple with the Context field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PostgresDatabaseParameter) GetContextOk() (*string, bool) { + if o == nil || IsNil(o.Context) { + return nil, false + } + return o.Context, true +} + +// HasContext returns a boolean if a field has been set. +func (o *PostgresDatabaseParameter) HasContext() bool { + if o != nil && !IsNil(o.Context) { + return true + } + + return false +} + +// SetContext gets a reference to the given string and assigns it to the Context field. +func (o *PostgresDatabaseParameter) SetContext(v string) { + o.Context = &v +} + +// GetDataType returns the DataType field value if set, zero value otherwise. +func (o *PostgresDatabaseParameter) GetDataType() string { + if o == nil || IsNil(o.DataType) { + var ret string + return ret + } + return *o.DataType +} + +// GetDataTypeOk returns a tuple with the DataType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PostgresDatabaseParameter) GetDataTypeOk() (*string, bool) { + if o == nil || IsNil(o.DataType) { + return nil, false + } + return o.DataType, true +} + +// HasDataType returns a boolean if a field has been set. +func (o *PostgresDatabaseParameter) HasDataType() bool { + if o != nil && !IsNil(o.DataType) { + return true + } + + return false +} + +// SetDataType gets a reference to the given string and assigns it to the DataType field. +func (o *PostgresDatabaseParameter) SetDataType(v string) { + o.DataType = &v +} + +// GetDefaultValue returns the DefaultValue field value if set, zero value otherwise. +func (o *PostgresDatabaseParameter) GetDefaultValue() string { + if o == nil || IsNil(o.DefaultValue) { + var ret string + return ret + } + return *o.DefaultValue +} + +// GetDefaultValueOk returns a tuple with the DefaultValue field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PostgresDatabaseParameter) GetDefaultValueOk() (*string, bool) { + if o == nil || IsNil(o.DefaultValue) { + return nil, false + } + return o.DefaultValue, true +} + +// HasDefaultValue returns a boolean if a field has been set. +func (o *PostgresDatabaseParameter) HasDefaultValue() bool { + if o != nil && !IsNil(o.DefaultValue) { + return true + } + + return false +} + +// SetDefaultValue gets a reference to the given string and assigns it to the DefaultValue field. +func (o *PostgresDatabaseParameter) SetDefaultValue(v string) { + o.DefaultValue = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PostgresDatabaseParameter) 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 *PostgresDatabaseParameter) 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 *PostgresDatabaseParameter) 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 *PostgresDatabaseParameter) SetDescription(v string) { + o.Description = &v +} + +// GetEdit returns the Edit field value if set, zero value otherwise. +func (o *PostgresDatabaseParameter) GetEdit() bool { + if o == nil || IsNil(o.Edit) { + var ret bool + return ret + } + return *o.Edit +} + +// GetEditOk returns a tuple with the Edit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PostgresDatabaseParameter) GetEditOk() (*bool, bool) { + if o == nil || IsNil(o.Edit) { + return nil, false + } + return o.Edit, true +} + +// HasEdit returns a boolean if a field has been set. +func (o *PostgresDatabaseParameter) HasEdit() bool { + if o != nil && !IsNil(o.Edit) { + return true + } + + return false +} + +// SetEdit gets a reference to the given bool and assigns it to the Edit field. +func (o *PostgresDatabaseParameter) SetEdit(v bool) { + o.Edit = &v +} + +// GetMaxValue returns the MaxValue field value if set, zero value otherwise. +func (o *PostgresDatabaseParameter) GetMaxValue() string { + if o == nil || IsNil(o.MaxValue) { + var ret string + return ret + } + return *o.MaxValue +} + +// GetMaxValueOk returns a tuple with the MaxValue field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PostgresDatabaseParameter) GetMaxValueOk() (*string, bool) { + if o == nil || IsNil(o.MaxValue) { + return nil, false + } + return o.MaxValue, true +} + +// HasMaxValue returns a boolean if a field has been set. +func (o *PostgresDatabaseParameter) HasMaxValue() bool { + if o != nil && !IsNil(o.MaxValue) { + return true + } + + return false +} + +// SetMaxValue gets a reference to the given string and assigns it to the MaxValue field. +func (o *PostgresDatabaseParameter) SetMaxValue(v string) { + o.MaxValue = &v +} + +// GetMinValue returns the MinValue field value if set, zero value otherwise. +func (o *PostgresDatabaseParameter) GetMinValue() string { + if o == nil || IsNil(o.MinValue) { + var ret string + return ret + } + return *o.MinValue +} + +// GetMinValueOk returns a tuple with the MinValue field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PostgresDatabaseParameter) GetMinValueOk() (*string, bool) { + if o == nil || IsNil(o.MinValue) { + return nil, false + } + return o.MinValue, true +} + +// HasMinValue returns a boolean if a field has been set. +func (o *PostgresDatabaseParameter) HasMinValue() bool { + if o != nil && !IsNil(o.MinValue) { + return true + } + + return false +} + +// SetMinValue gets a reference to the given string and assigns it to the MinValue field. +func (o *PostgresDatabaseParameter) SetMinValue(v string) { + o.MinValue = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PostgresDatabaseParameter) 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 *PostgresDatabaseParameter) 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 *PostgresDatabaseParameter) 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 *PostgresDatabaseParameter) SetName(v string) { + o.Name = &v +} + +// GetPendingRestart returns the PendingRestart field value if set, zero value otherwise. +func (o *PostgresDatabaseParameter) GetPendingRestart() bool { + if o == nil || IsNil(o.PendingRestart) { + var ret bool + return ret + } + return *o.PendingRestart +} + +// GetPendingRestartOk returns a tuple with the PendingRestart field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PostgresDatabaseParameter) GetPendingRestartOk() (*bool, bool) { + if o == nil || IsNil(o.PendingRestart) { + return nil, false + } + return o.PendingRestart, true +} + +// HasPendingRestart returns a boolean if a field has been set. +func (o *PostgresDatabaseParameter) HasPendingRestart() bool { + if o != nil && !IsNil(o.PendingRestart) { + return true + } + + return false +} + +// SetPendingRestart gets a reference to the given bool and assigns it to the PendingRestart field. +func (o *PostgresDatabaseParameter) SetPendingRestart(v bool) { + o.PendingRestart = &v +} + +// GetResetValue returns the ResetValue field value if set, zero value otherwise. +func (o *PostgresDatabaseParameter) GetResetValue() string { + if o == nil || IsNil(o.ResetValue) { + var ret string + return ret + } + return *o.ResetValue +} + +// GetResetValueOk returns a tuple with the ResetValue field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PostgresDatabaseParameter) GetResetValueOk() (*string, bool) { + if o == nil || IsNil(o.ResetValue) { + return nil, false + } + return o.ResetValue, true +} + +// HasResetValue returns a boolean if a field has been set. +func (o *PostgresDatabaseParameter) HasResetValue() bool { + if o != nil && !IsNil(o.ResetValue) { + return true + } + + return false +} + +// SetResetValue gets a reference to the given string and assigns it to the ResetValue field. +func (o *PostgresDatabaseParameter) SetResetValue(v string) { + o.ResetValue = &v +} + +// GetUnit returns the Unit field value if set, zero value otherwise. +func (o *PostgresDatabaseParameter) GetUnit() string { + if o == nil || IsNil(o.Unit) { + var ret string + return ret + } + return *o.Unit +} + +// GetUnitOk returns a tuple with the Unit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PostgresDatabaseParameter) GetUnitOk() (*string, bool) { + if o == nil || IsNil(o.Unit) { + return nil, false + } + return o.Unit, true +} + +// HasUnit returns a boolean if a field has been set. +func (o *PostgresDatabaseParameter) HasUnit() bool { + if o != nil && !IsNil(o.Unit) { + return true + } + + return false +} + +// SetUnit gets a reference to the given string and assigns it to the Unit field. +func (o *PostgresDatabaseParameter) SetUnit(v string) { + o.Unit = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *PostgresDatabaseParameter) GetValue() string { + if o == nil || IsNil(o.Value) { + var ret string + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PostgresDatabaseParameter) GetValueOk() (*string, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *PostgresDatabaseParameter) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given string and assigns it to the Value field. +func (o *PostgresDatabaseParameter) SetValue(v string) { + o.Value = &v +} + +func (o PostgresDatabaseParameter) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PostgresDatabaseParameter) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Context) { + toSerialize["context"] = o.Context + } + if !IsNil(o.DataType) { + toSerialize["dataType"] = o.DataType + } + if !IsNil(o.DefaultValue) { + toSerialize["defaultValue"] = o.DefaultValue + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Edit) { + toSerialize["edit"] = o.Edit + } + if !IsNil(o.MaxValue) { + toSerialize["maxValue"] = o.MaxValue + } + if !IsNil(o.MinValue) { + toSerialize["minValue"] = o.MinValue + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.PendingRestart) { + toSerialize["pendingRestart"] = o.PendingRestart + } + if !IsNil(o.ResetValue) { + toSerialize["resetValue"] = o.ResetValue + } + if !IsNil(o.Unit) { + toSerialize["unit"] = o.Unit + } + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + return toSerialize, nil +} + +type NullablePostgresDatabaseParameter struct { + value *PostgresDatabaseParameter + isSet bool +} + +func (v NullablePostgresDatabaseParameter) Get() *PostgresDatabaseParameter { + return v.value +} + +func (v *NullablePostgresDatabaseParameter) Set(val *PostgresDatabaseParameter) { + v.value = val + v.isSet = true +} + +func (v NullablePostgresDatabaseParameter) IsSet() bool { + return v.isSet +} + +func (v *NullablePostgresDatabaseParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePostgresDatabaseParameter(val *PostgresDatabaseParameter) *NullablePostgresDatabaseParameter { + return &NullablePostgresDatabaseParameter{value: val, isSet: true} +} + +func (v NullablePostgresDatabaseParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePostgresDatabaseParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_postgres_database_parameter_response.go b/services/postgresflex/v2api/model_postgres_database_parameter_response.go new file mode 100644 index 000000000..341403de9 --- /dev/null +++ b/services/postgresflex/v2api/model_postgres_database_parameter_response.go @@ -0,0 +1,126 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the PostgresDatabaseParameterResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PostgresDatabaseParameterResponse{} + +// PostgresDatabaseParameterResponse struct for PostgresDatabaseParameterResponse +type PostgresDatabaseParameterResponse struct { + // List of the parameter + Parameter []PostgresDatabaseParameter `json:"parameter,omitempty"` +} + +// NewPostgresDatabaseParameterResponse instantiates a new PostgresDatabaseParameterResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPostgresDatabaseParameterResponse() *PostgresDatabaseParameterResponse { + this := PostgresDatabaseParameterResponse{} + return &this +} + +// NewPostgresDatabaseParameterResponseWithDefaults instantiates a new PostgresDatabaseParameterResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPostgresDatabaseParameterResponseWithDefaults() *PostgresDatabaseParameterResponse { + this := PostgresDatabaseParameterResponse{} + return &this +} + +// GetParameter returns the Parameter field value if set, zero value otherwise. +func (o *PostgresDatabaseParameterResponse) GetParameter() []PostgresDatabaseParameter { + if o == nil || IsNil(o.Parameter) { + var ret []PostgresDatabaseParameter + return ret + } + return o.Parameter +} + +// GetParameterOk returns a tuple with the Parameter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PostgresDatabaseParameterResponse) GetParameterOk() ([]PostgresDatabaseParameter, bool) { + if o == nil || IsNil(o.Parameter) { + return nil, false + } + return o.Parameter, true +} + +// HasParameter returns a boolean if a field has been set. +func (o *PostgresDatabaseParameterResponse) HasParameter() bool { + if o != nil && !IsNil(o.Parameter) { + return true + } + + return false +} + +// SetParameter gets a reference to the given []PostgresDatabaseParameter and assigns it to the Parameter field. +func (o *PostgresDatabaseParameterResponse) SetParameter(v []PostgresDatabaseParameter) { + o.Parameter = v +} + +func (o PostgresDatabaseParameterResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PostgresDatabaseParameterResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Parameter) { + toSerialize["parameter"] = o.Parameter + } + return toSerialize, nil +} + +type NullablePostgresDatabaseParameterResponse struct { + value *PostgresDatabaseParameterResponse + isSet bool +} + +func (v NullablePostgresDatabaseParameterResponse) Get() *PostgresDatabaseParameterResponse { + return v.value +} + +func (v *NullablePostgresDatabaseParameterResponse) Set(val *PostgresDatabaseParameterResponse) { + v.value = val + v.isSet = true +} + +func (v NullablePostgresDatabaseParameterResponse) IsSet() bool { + return v.isSet +} + +func (v *NullablePostgresDatabaseParameterResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePostgresDatabaseParameterResponse(val *PostgresDatabaseParameterResponse) *NullablePostgresDatabaseParameterResponse { + return &NullablePostgresDatabaseParameterResponse{value: val, isSet: true} +} + +func (v NullablePostgresDatabaseParameterResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePostgresDatabaseParameterResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_reset_user_response.go b/services/postgresflex/v2api/model_reset_user_response.go new file mode 100644 index 000000000..27aa3ca02 --- /dev/null +++ b/services/postgresflex/v2api/model_reset_user_response.go @@ -0,0 +1,125 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the ResetUserResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ResetUserResponse{} + +// ResetUserResponse struct for ResetUserResponse +type ResetUserResponse struct { + Item *User `json:"item,omitempty"` +} + +// NewResetUserResponse instantiates a new ResetUserResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewResetUserResponse() *ResetUserResponse { + this := ResetUserResponse{} + return &this +} + +// NewResetUserResponseWithDefaults instantiates a new ResetUserResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewResetUserResponseWithDefaults() *ResetUserResponse { + this := ResetUserResponse{} + return &this +} + +// GetItem returns the Item field value if set, zero value otherwise. +func (o *ResetUserResponse) GetItem() User { + if o == nil || IsNil(o.Item) { + var ret User + return ret + } + return *o.Item +} + +// GetItemOk returns a tuple with the Item field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResetUserResponse) GetItemOk() (*User, bool) { + if o == nil || IsNil(o.Item) { + return nil, false + } + return o.Item, true +} + +// HasItem returns a boolean if a field has been set. +func (o *ResetUserResponse) HasItem() bool { + if o != nil && !IsNil(o.Item) { + return true + } + + return false +} + +// SetItem gets a reference to the given User and assigns it to the Item field. +func (o *ResetUserResponse) SetItem(v User) { + o.Item = &v +} + +func (o ResetUserResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ResetUserResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Item) { + toSerialize["item"] = o.Item + } + return toSerialize, nil +} + +type NullableResetUserResponse struct { + value *ResetUserResponse + isSet bool +} + +func (v NullableResetUserResponse) Get() *ResetUserResponse { + return v.value +} + +func (v *NullableResetUserResponse) Set(val *ResetUserResponse) { + v.value = val + v.isSet = true +} + +func (v NullableResetUserResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableResetUserResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResetUserResponse(val *ResetUserResponse) *NullableResetUserResponse { + return &NullableResetUserResponse{value: val, isSet: true} +} + +func (v NullableResetUserResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResetUserResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_storage.go b/services/postgresflex/v2api/model_storage.go new file mode 100644 index 000000000..49398cf7f --- /dev/null +++ b/services/postgresflex/v2api/model_storage.go @@ -0,0 +1,161 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the Storage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Storage{} + +// Storage struct for Storage +type Storage struct { + Class *string `json:"class,omitempty"` + Size *int64 `json:"size,omitempty"` +} + +// NewStorage instantiates a new Storage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStorage() *Storage { + this := Storage{} + return &this +} + +// NewStorageWithDefaults instantiates a new Storage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStorageWithDefaults() *Storage { + this := Storage{} + return &this +} + +// GetClass returns the Class field value if set, zero value otherwise. +func (o *Storage) GetClass() string { + if o == nil || IsNil(o.Class) { + var ret string + return ret + } + return *o.Class +} + +// GetClassOk returns a tuple with the Class field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Storage) GetClassOk() (*string, bool) { + if o == nil || IsNil(o.Class) { + return nil, false + } + return o.Class, true +} + +// HasClass returns a boolean if a field has been set. +func (o *Storage) HasClass() bool { + if o != nil && !IsNil(o.Class) { + return true + } + + return false +} + +// SetClass gets a reference to the given string and assigns it to the Class field. +func (o *Storage) SetClass(v string) { + o.Class = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *Storage) 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 *Storage) 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 *Storage) 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 *Storage) SetSize(v int64) { + o.Size = &v +} + +func (o Storage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Storage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Class) { + toSerialize["class"] = o.Class + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + return toSerialize, nil +} + +type NullableStorage struct { + value *Storage + isSet bool +} + +func (v NullableStorage) Get() *Storage { + return v.value +} + +func (v *NullableStorage) Set(val *Storage) { + v.value = val + v.isSet = true +} + +func (v NullableStorage) IsSet() bool { + return v.isSet +} + +func (v *NullableStorage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStorage(val *Storage) *NullableStorage { + return &NullableStorage{value: val, isSet: true} +} + +func (v NullableStorage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStorage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_storage_range.go b/services/postgresflex/v2api/model_storage_range.go new file mode 100644 index 000000000..2dd8d3f7e --- /dev/null +++ b/services/postgresflex/v2api/model_storage_range.go @@ -0,0 +1,161 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the StorageRange type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &StorageRange{} + +// StorageRange struct for StorageRange +type StorageRange struct { + Max *int64 `json:"max,omitempty"` + Min *int64 `json:"min,omitempty"` +} + +// NewStorageRange instantiates a new StorageRange object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStorageRange() *StorageRange { + this := StorageRange{} + return &this +} + +// NewStorageRangeWithDefaults instantiates a new StorageRange object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStorageRangeWithDefaults() *StorageRange { + this := StorageRange{} + return &this +} + +// GetMax returns the Max field value if set, zero value otherwise. +func (o *StorageRange) GetMax() int64 { + if o == nil || IsNil(o.Max) { + var ret int64 + return ret + } + return *o.Max +} + +// GetMaxOk returns a tuple with the Max field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StorageRange) GetMaxOk() (*int64, bool) { + if o == nil || IsNil(o.Max) { + return nil, false + } + return o.Max, true +} + +// HasMax returns a boolean if a field has been set. +func (o *StorageRange) HasMax() bool { + if o != nil && !IsNil(o.Max) { + return true + } + + return false +} + +// SetMax gets a reference to the given int64 and assigns it to the Max field. +func (o *StorageRange) SetMax(v int64) { + o.Max = &v +} + +// GetMin returns the Min field value if set, zero value otherwise. +func (o *StorageRange) GetMin() int64 { + if o == nil || IsNil(o.Min) { + var ret int64 + return ret + } + return *o.Min +} + +// GetMinOk returns a tuple with the Min field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StorageRange) GetMinOk() (*int64, bool) { + if o == nil || IsNil(o.Min) { + return nil, false + } + return o.Min, true +} + +// HasMin returns a boolean if a field has been set. +func (o *StorageRange) HasMin() bool { + if o != nil && !IsNil(o.Min) { + return true + } + + return false +} + +// SetMin gets a reference to the given int64 and assigns it to the Min field. +func (o *StorageRange) SetMin(v int64) { + o.Min = &v +} + +func (o StorageRange) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o StorageRange) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Max) { + toSerialize["max"] = o.Max + } + if !IsNil(o.Min) { + toSerialize["min"] = o.Min + } + return toSerialize, nil +} + +type NullableStorageRange struct { + value *StorageRange + isSet bool +} + +func (v NullableStorageRange) Get() *StorageRange { + return v.value +} + +func (v *NullableStorageRange) Set(val *StorageRange) { + v.value = val + v.isSet = true +} + +func (v NullableStorageRange) IsSet() bool { + return v.isSet +} + +func (v *NullableStorageRange) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStorageRange(val *StorageRange) *NullableStorageRange { + return &NullableStorageRange{value: val, isSet: true} +} + +func (v NullableStorageRange) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStorageRange) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_storage_update.go b/services/postgresflex/v2api/model_storage_update.go new file mode 100644 index 000000000..44e6f78a8 --- /dev/null +++ b/services/postgresflex/v2api/model_storage_update.go @@ -0,0 +1,166 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the StorageUpdate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &StorageUpdate{} + +// StorageUpdate struct for StorageUpdate +type StorageUpdate struct { + // ⚠️ **DEPRECATED AND NON-FUNCTIONAL:** Updating the performance class field is not possible. + // Deprecated + Class *string `json:"class,omitempty"` + Size *int64 `json:"size,omitempty"` +} + +// NewStorageUpdate instantiates a new StorageUpdate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStorageUpdate() *StorageUpdate { + this := StorageUpdate{} + return &this +} + +// NewStorageUpdateWithDefaults instantiates a new StorageUpdate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStorageUpdateWithDefaults() *StorageUpdate { + this := StorageUpdate{} + return &this +} + +// GetClass returns the Class field value if set, zero value otherwise. +// Deprecated +func (o *StorageUpdate) GetClass() string { + if o == nil || IsNil(o.Class) { + var ret string + return ret + } + return *o.Class +} + +// GetClassOk returns a tuple with the Class field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *StorageUpdate) GetClassOk() (*string, bool) { + if o == nil || IsNil(o.Class) { + return nil, false + } + return o.Class, true +} + +// HasClass returns a boolean if a field has been set. +func (o *StorageUpdate) HasClass() bool { + if o != nil && !IsNil(o.Class) { + return true + } + + return false +} + +// SetClass gets a reference to the given string and assigns it to the Class field. +// Deprecated +func (o *StorageUpdate) SetClass(v string) { + o.Class = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *StorageUpdate) 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 *StorageUpdate) 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 *StorageUpdate) 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 *StorageUpdate) SetSize(v int64) { + o.Size = &v +} + +func (o StorageUpdate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o StorageUpdate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Class) { + toSerialize["class"] = o.Class + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + return toSerialize, nil +} + +type NullableStorageUpdate struct { + value *StorageUpdate + isSet bool +} + +func (v NullableStorageUpdate) Get() *StorageUpdate { + return v.value +} + +func (v *NullableStorageUpdate) Set(val *StorageUpdate) { + v.value = val + v.isSet = true +} + +func (v NullableStorageUpdate) IsSet() bool { + return v.isSet +} + +func (v *NullableStorageUpdate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStorageUpdate(val *StorageUpdate) *NullableStorageUpdate { + return &NullableStorageUpdate{value: val, isSet: true} +} + +func (v NullableStorageUpdate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStorageUpdate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_update_backup_schedule_payload.go b/services/postgresflex/v2api/model_update_backup_schedule_payload.go new file mode 100644 index 000000000..0694f8c5c --- /dev/null +++ b/services/postgresflex/v2api/model_update_backup_schedule_payload.go @@ -0,0 +1,157 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the UpdateBackupSchedulePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateBackupSchedulePayload{} + +// UpdateBackupSchedulePayload struct for UpdateBackupSchedulePayload +type UpdateBackupSchedulePayload struct { + BackupSchedule string `json:"backupSchedule"` +} + +type _UpdateBackupSchedulePayload UpdateBackupSchedulePayload + +// NewUpdateBackupSchedulePayload instantiates a new UpdateBackupSchedulePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateBackupSchedulePayload(backupSchedule string) *UpdateBackupSchedulePayload { + this := UpdateBackupSchedulePayload{} + this.BackupSchedule = backupSchedule + return &this +} + +// NewUpdateBackupSchedulePayloadWithDefaults instantiates a new UpdateBackupSchedulePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateBackupSchedulePayloadWithDefaults() *UpdateBackupSchedulePayload { + this := UpdateBackupSchedulePayload{} + return &this +} + +// GetBackupSchedule returns the BackupSchedule field value +func (o *UpdateBackupSchedulePayload) GetBackupSchedule() string { + if o == nil { + var ret string + return ret + } + + return o.BackupSchedule +} + +// GetBackupScheduleOk returns a tuple with the BackupSchedule field value +// and a boolean to check if the value has been set. +func (o *UpdateBackupSchedulePayload) GetBackupScheduleOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BackupSchedule, true +} + +// SetBackupSchedule sets field value +func (o *UpdateBackupSchedulePayload) SetBackupSchedule(v string) { + o.BackupSchedule = v +} + +func (o UpdateBackupSchedulePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateBackupSchedulePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["backupSchedule"] = o.BackupSchedule + return toSerialize, nil +} + +func (o *UpdateBackupSchedulePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "backupSchedule", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUpdateBackupSchedulePayload := _UpdateBackupSchedulePayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varUpdateBackupSchedulePayload) + + if err != nil { + return err + } + + *o = UpdateBackupSchedulePayload(varUpdateBackupSchedulePayload) + + return err +} + +type NullableUpdateBackupSchedulePayload struct { + value *UpdateBackupSchedulePayload + isSet bool +} + +func (v NullableUpdateBackupSchedulePayload) Get() *UpdateBackupSchedulePayload { + return v.value +} + +func (v *NullableUpdateBackupSchedulePayload) Set(val *UpdateBackupSchedulePayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateBackupSchedulePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateBackupSchedulePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateBackupSchedulePayload(val *UpdateBackupSchedulePayload) *NullableUpdateBackupSchedulePayload { + return &NullableUpdateBackupSchedulePayload{value: val, isSet: true} +} + +func (v NullableUpdateBackupSchedulePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateBackupSchedulePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_update_instance_payload.go b/services/postgresflex/v2api/model_update_instance_payload.go new file mode 100644 index 000000000..770448280 --- /dev/null +++ b/services/postgresflex/v2api/model_update_instance_payload.go @@ -0,0 +1,414 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the UpdateInstancePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateInstancePayload{} + +// UpdateInstancePayload struct for UpdateInstancePayload +type UpdateInstancePayload struct { + Acl *ACL `json:"acl,omitempty"` + BackupSchedule *string `json:"backupSchedule,omitempty"` + FlavorId *string `json:"flavorId,omitempty"` + // Labels field is not certain/clear + Labels *map[string]string `json:"labels,omitempty"` + Name *string `json:"name,omitempty"` + Options *map[string]string `json:"options,omitempty"` + Replicas *int32 `json:"replicas,omitempty"` + Storage *StorageUpdate `json:"storage,omitempty"` + Version *string `json:"version,omitempty"` +} + +// NewUpdateInstancePayload instantiates a new UpdateInstancePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateInstancePayload() *UpdateInstancePayload { + this := UpdateInstancePayload{} + return &this +} + +// NewUpdateInstancePayloadWithDefaults instantiates a new UpdateInstancePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateInstancePayloadWithDefaults() *UpdateInstancePayload { + this := UpdateInstancePayload{} + return &this +} + +// GetAcl returns the Acl field value if set, zero value otherwise. +func (o *UpdateInstancePayload) GetAcl() ACL { + if o == nil || IsNil(o.Acl) { + var ret ACL + return ret + } + return *o.Acl +} + +// GetAclOk returns a tuple with the Acl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateInstancePayload) GetAclOk() (*ACL, bool) { + if o == nil || IsNil(o.Acl) { + return nil, false + } + return o.Acl, true +} + +// HasAcl returns a boolean if a field has been set. +func (o *UpdateInstancePayload) HasAcl() bool { + if o != nil && !IsNil(o.Acl) { + return true + } + + return false +} + +// SetAcl gets a reference to the given ACL and assigns it to the Acl field. +func (o *UpdateInstancePayload) SetAcl(v ACL) { + o.Acl = &v +} + +// GetBackupSchedule returns the BackupSchedule field value if set, zero value otherwise. +func (o *UpdateInstancePayload) GetBackupSchedule() string { + if o == nil || IsNil(o.BackupSchedule) { + var ret string + return ret + } + return *o.BackupSchedule +} + +// GetBackupScheduleOk returns a tuple with the BackupSchedule field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateInstancePayload) GetBackupScheduleOk() (*string, bool) { + if o == nil || IsNil(o.BackupSchedule) { + return nil, false + } + return o.BackupSchedule, true +} + +// HasBackupSchedule returns a boolean if a field has been set. +func (o *UpdateInstancePayload) HasBackupSchedule() bool { + if o != nil && !IsNil(o.BackupSchedule) { + return true + } + + return false +} + +// SetBackupSchedule gets a reference to the given string and assigns it to the BackupSchedule field. +func (o *UpdateInstancePayload) SetBackupSchedule(v string) { + o.BackupSchedule = &v +} + +// GetFlavorId returns the FlavorId field value if set, zero value otherwise. +func (o *UpdateInstancePayload) GetFlavorId() string { + if o == nil || IsNil(o.FlavorId) { + var ret string + return ret + } + return *o.FlavorId +} + +// GetFlavorIdOk returns a tuple with the FlavorId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateInstancePayload) GetFlavorIdOk() (*string, bool) { + if o == nil || IsNil(o.FlavorId) { + return nil, false + } + return o.FlavorId, true +} + +// HasFlavorId returns a boolean if a field has been set. +func (o *UpdateInstancePayload) HasFlavorId() bool { + if o != nil && !IsNil(o.FlavorId) { + return true + } + + return false +} + +// SetFlavorId gets a reference to the given string and assigns it to the FlavorId field. +func (o *UpdateInstancePayload) SetFlavorId(v string) { + o.FlavorId = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateInstancePayload) GetLabels() map[string]string { + if o == nil || IsNil(o.Labels) { + var ret map[string]string + 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 *UpdateInstancePayload) GetLabelsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Labels) { + return nil, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateInstancePayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *UpdateInstancePayload) SetLabels(v map[string]string) { + o.Labels = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateInstancePayload) 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 *UpdateInstancePayload) 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 *UpdateInstancePayload) 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 *UpdateInstancePayload) SetName(v string) { + o.Name = &v +} + +// GetOptions returns the Options field value if set, zero value otherwise. +func (o *UpdateInstancePayload) GetOptions() map[string]string { + if o == nil || IsNil(o.Options) { + var ret map[string]string + return ret + } + return *o.Options +} + +// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateInstancePayload) GetOptionsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Options) { + return nil, false + } + return o.Options, true +} + +// HasOptions returns a boolean if a field has been set. +func (o *UpdateInstancePayload) HasOptions() bool { + if o != nil && !IsNil(o.Options) { + return true + } + + return false +} + +// SetOptions gets a reference to the given map[string]string and assigns it to the Options field. +func (o *UpdateInstancePayload) SetOptions(v map[string]string) { + o.Options = &v +} + +// GetReplicas returns the Replicas field value if set, zero value otherwise. +func (o *UpdateInstancePayload) GetReplicas() int32 { + if o == nil || IsNil(o.Replicas) { + var ret int32 + return ret + } + return *o.Replicas +} + +// GetReplicasOk returns a tuple with the Replicas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateInstancePayload) GetReplicasOk() (*int32, bool) { + if o == nil || IsNil(o.Replicas) { + return nil, false + } + return o.Replicas, true +} + +// HasReplicas returns a boolean if a field has been set. +func (o *UpdateInstancePayload) HasReplicas() bool { + if o != nil && !IsNil(o.Replicas) { + return true + } + + return false +} + +// SetReplicas gets a reference to the given int32 and assigns it to the Replicas field. +func (o *UpdateInstancePayload) SetReplicas(v int32) { + o.Replicas = &v +} + +// GetStorage returns the Storage field value if set, zero value otherwise. +func (o *UpdateInstancePayload) GetStorage() StorageUpdate { + if o == nil || IsNil(o.Storage) { + var ret StorageUpdate + return ret + } + return *o.Storage +} + +// GetStorageOk returns a tuple with the Storage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateInstancePayload) GetStorageOk() (*StorageUpdate, bool) { + if o == nil || IsNil(o.Storage) { + return nil, false + } + return o.Storage, true +} + +// HasStorage returns a boolean if a field has been set. +func (o *UpdateInstancePayload) HasStorage() bool { + if o != nil && !IsNil(o.Storage) { + return true + } + + return false +} + +// SetStorage gets a reference to the given StorageUpdate and assigns it to the Storage field. +func (o *UpdateInstancePayload) SetStorage(v StorageUpdate) { + o.Storage = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *UpdateInstancePayload) GetVersion() string { + if o == nil || IsNil(o.Version) { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateInstancePayload) GetVersionOk() (*string, bool) { + if o == nil || IsNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *UpdateInstancePayload) HasVersion() bool { + if o != nil && !IsNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *UpdateInstancePayload) SetVersion(v string) { + o.Version = &v +} + +func (o UpdateInstancePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateInstancePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Acl) { + toSerialize["acl"] = o.Acl + } + if !IsNil(o.BackupSchedule) { + toSerialize["backupSchedule"] = o.BackupSchedule + } + if !IsNil(o.FlavorId) { + toSerialize["flavorId"] = o.FlavorId + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Options) { + toSerialize["options"] = o.Options + } + if !IsNil(o.Replicas) { + toSerialize["replicas"] = o.Replicas + } + if !IsNil(o.Storage) { + toSerialize["storage"] = o.Storage + } + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + return toSerialize, nil +} + +type NullableUpdateInstancePayload struct { + value *UpdateInstancePayload + isSet bool +} + +func (v NullableUpdateInstancePayload) Get() *UpdateInstancePayload { + return v.value +} + +func (v *NullableUpdateInstancePayload) Set(val *UpdateInstancePayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateInstancePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateInstancePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateInstancePayload(val *UpdateInstancePayload) *NullableUpdateInstancePayload { + return &NullableUpdateInstancePayload{value: val, isSet: true} +} + +func (v NullableUpdateInstancePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateInstancePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_update_user_payload.go b/services/postgresflex/v2api/model_update_user_payload.go new file mode 100644 index 000000000..0a3fe7820 --- /dev/null +++ b/services/postgresflex/v2api/model_update_user_payload.go @@ -0,0 +1,161 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the UpdateUserPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateUserPayload{} + +// UpdateUserPayload struct for UpdateUserPayload +type UpdateUserPayload struct { + Database *string `json:"database,omitempty"` + Roles []string `json:"roles,omitempty"` +} + +// NewUpdateUserPayload instantiates a new UpdateUserPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateUserPayload() *UpdateUserPayload { + this := UpdateUserPayload{} + return &this +} + +// NewUpdateUserPayloadWithDefaults instantiates a new UpdateUserPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateUserPayloadWithDefaults() *UpdateUserPayload { + this := UpdateUserPayload{} + return &this +} + +// GetDatabase returns the Database field value if set, zero value otherwise. +func (o *UpdateUserPayload) GetDatabase() string { + if o == nil || IsNil(o.Database) { + var ret string + return ret + } + return *o.Database +} + +// GetDatabaseOk returns a tuple with the Database field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateUserPayload) GetDatabaseOk() (*string, bool) { + if o == nil || IsNil(o.Database) { + return nil, false + } + return o.Database, true +} + +// HasDatabase returns a boolean if a field has been set. +func (o *UpdateUserPayload) HasDatabase() bool { + if o != nil && !IsNil(o.Database) { + return true + } + + return false +} + +// SetDatabase gets a reference to the given string and assigns it to the Database field. +func (o *UpdateUserPayload) SetDatabase(v string) { + o.Database = &v +} + +// GetRoles returns the Roles field value if set, zero value otherwise. +func (o *UpdateUserPayload) GetRoles() []string { + if o == nil || IsNil(o.Roles) { + var ret []string + return ret + } + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateUserPayload) GetRolesOk() ([]string, bool) { + if o == nil || IsNil(o.Roles) { + return nil, false + } + return o.Roles, true +} + +// HasRoles returns a boolean if a field has been set. +func (o *UpdateUserPayload) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { + return true + } + + return false +} + +// SetRoles gets a reference to the given []string and assigns it to the Roles field. +func (o *UpdateUserPayload) SetRoles(v []string) { + o.Roles = v +} + +func (o UpdateUserPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateUserPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Database) { + toSerialize["database"] = o.Database + } + if !IsNil(o.Roles) { + toSerialize["roles"] = o.Roles + } + return toSerialize, nil +} + +type NullableUpdateUserPayload struct { + value *UpdateUserPayload + isSet bool +} + +func (v NullableUpdateUserPayload) Get() *UpdateUserPayload { + return v.value +} + +func (v *NullableUpdateUserPayload) Set(val *UpdateUserPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateUserPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateUserPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateUserPayload(val *UpdateUserPayload) *NullableUpdateUserPayload { + return &NullableUpdateUserPayload{value: val, isSet: true} +} + +func (v NullableUpdateUserPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateUserPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_user.go b/services/postgresflex/v2api/model_user.go new file mode 100644 index 000000000..43440b0ca --- /dev/null +++ b/services/postgresflex/v2api/model_user.go @@ -0,0 +1,377 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the User type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &User{} + +// User struct for User +type User struct { + Database *string `json:"database,omitempty"` + Host *string `json:"host,omitempty"` + Id *string `json:"id,omitempty"` + Password *string `json:"password,omitempty"` + Port *int64 `json:"port,omitempty"` + Roles []string `json:"roles,omitempty"` + Uri *string `json:"uri,omitempty"` + Username *string `json:"username,omitempty"` +} + +// NewUser instantiates a new User object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUser() *User { + this := User{} + return &this +} + +// NewUserWithDefaults instantiates a new User object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserWithDefaults() *User { + this := User{} + return &this +} + +// GetDatabase returns the Database field value if set, zero value otherwise. +func (o *User) GetDatabase() string { + if o == nil || IsNil(o.Database) { + var ret string + return ret + } + return *o.Database +} + +// GetDatabaseOk returns a tuple with the Database field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetDatabaseOk() (*string, bool) { + if o == nil || IsNil(o.Database) { + return nil, false + } + return o.Database, true +} + +// HasDatabase returns a boolean if a field has been set. +func (o *User) HasDatabase() bool { + if o != nil && !IsNil(o.Database) { + return true + } + + return false +} + +// SetDatabase gets a reference to the given string and assigns it to the Database field. +func (o *User) SetDatabase(v string) { + o.Database = &v +} + +// GetHost returns the Host field value if set, zero value otherwise. +func (o *User) GetHost() string { + if o == nil || IsNil(o.Host) { + var ret string + return ret + } + return *o.Host +} + +// GetHostOk returns a tuple with the Host field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetHostOk() (*string, bool) { + if o == nil || IsNil(o.Host) { + return nil, false + } + return o.Host, true +} + +// HasHost returns a boolean if a field has been set. +func (o *User) HasHost() bool { + if o != nil && !IsNil(o.Host) { + return true + } + + return false +} + +// SetHost gets a reference to the given string and assigns it to the Host field. +func (o *User) SetHost(v string) { + o.Host = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *User) 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 *User) 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 *User) 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 *User) SetId(v string) { + o.Id = &v +} + +// GetPassword returns the Password field value if set, zero value otherwise. +func (o *User) GetPassword() string { + if o == nil || IsNil(o.Password) { + var ret string + return ret + } + return *o.Password +} + +// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetPasswordOk() (*string, bool) { + if o == nil || IsNil(o.Password) { + return nil, false + } + return o.Password, true +} + +// HasPassword returns a boolean if a field has been set. +func (o *User) HasPassword() bool { + if o != nil && !IsNil(o.Password) { + return true + } + + return false +} + +// SetPassword gets a reference to the given string and assigns it to the Password field. +func (o *User) SetPassword(v string) { + o.Password = &v +} + +// GetPort returns the Port field value if set, zero value otherwise. +func (o *User) GetPort() int64 { + if o == nil || IsNil(o.Port) { + var ret int64 + return ret + } + return *o.Port +} + +// GetPortOk returns a tuple with the Port field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetPortOk() (*int64, bool) { + if o == nil || IsNil(o.Port) { + return nil, false + } + return o.Port, true +} + +// HasPort returns a boolean if a field has been set. +func (o *User) HasPort() bool { + if o != nil && !IsNil(o.Port) { + return true + } + + return false +} + +// SetPort gets a reference to the given int64 and assigns it to the Port field. +func (o *User) SetPort(v int64) { + o.Port = &v +} + +// GetRoles returns the Roles field value if set, zero value otherwise. +func (o *User) GetRoles() []string { + if o == nil || IsNil(o.Roles) { + var ret []string + return ret + } + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetRolesOk() ([]string, bool) { + if o == nil || IsNil(o.Roles) { + return nil, false + } + return o.Roles, true +} + +// HasRoles returns a boolean if a field has been set. +func (o *User) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { + return true + } + + return false +} + +// SetRoles gets a reference to the given []string and assigns it to the Roles field. +func (o *User) SetRoles(v []string) { + o.Roles = v +} + +// GetUri returns the Uri field value if set, zero value otherwise. +func (o *User) GetUri() string { + if o == nil || IsNil(o.Uri) { + var ret string + return ret + } + return *o.Uri +} + +// GetUriOk returns a tuple with the Uri field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetUriOk() (*string, bool) { + if o == nil || IsNil(o.Uri) { + return nil, false + } + return o.Uri, true +} + +// HasUri returns a boolean if a field has been set. +func (o *User) HasUri() bool { + if o != nil && !IsNil(o.Uri) { + return true + } + + return false +} + +// SetUri gets a reference to the given string and assigns it to the Uri field. +func (o *User) SetUri(v string) { + o.Uri = &v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *User) GetUsername() string { + if o == nil || IsNil(o.Username) { + var ret string + return ret + } + return *o.Username +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetUsernameOk() (*string, bool) { + if o == nil || IsNil(o.Username) { + return nil, false + } + return o.Username, true +} + +// HasUsername returns a boolean if a field has been set. +func (o *User) HasUsername() bool { + if o != nil && !IsNil(o.Username) { + return true + } + + return false +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *User) SetUsername(v string) { + o.Username = &v +} + +func (o User) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o User) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Database) { + toSerialize["database"] = o.Database + } + if !IsNil(o.Host) { + toSerialize["host"] = o.Host + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Password) { + toSerialize["password"] = o.Password + } + if !IsNil(o.Port) { + toSerialize["port"] = o.Port + } + if !IsNil(o.Roles) { + toSerialize["roles"] = o.Roles + } + if !IsNil(o.Uri) { + toSerialize["uri"] = o.Uri + } + if !IsNil(o.Username) { + toSerialize["username"] = o.Username + } + return toSerialize, nil +} + +type NullableUser struct { + value *User + isSet bool +} + +func (v NullableUser) Get() *User { + return v.value +} + +func (v *NullableUser) Set(val *User) { + v.value = val + v.isSet = true +} + +func (v NullableUser) IsSet() bool { + return v.isSet +} + +func (v *NullableUser) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUser(val *User) *NullableUser { + return &NullableUser{value: val, isSet: true} +} + +func (v NullableUser) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUser) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_user_response.go b/services/postgresflex/v2api/model_user_response.go new file mode 100644 index 000000000..107f7d2b4 --- /dev/null +++ b/services/postgresflex/v2api/model_user_response.go @@ -0,0 +1,269 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the UserResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserResponse{} + +// UserResponse struct for UserResponse +type UserResponse struct { + Host *string `json:"host,omitempty"` + Id *string `json:"id,omitempty"` + Port *int64 `json:"port,omitempty"` + Roles []string `json:"roles,omitempty"` + Username *string `json:"username,omitempty"` +} + +// NewUserResponse instantiates a new UserResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserResponse() *UserResponse { + this := UserResponse{} + return &this +} + +// NewUserResponseWithDefaults instantiates a new UserResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserResponseWithDefaults() *UserResponse { + this := UserResponse{} + return &this +} + +// GetHost returns the Host field value if set, zero value otherwise. +func (o *UserResponse) GetHost() string { + if o == nil || IsNil(o.Host) { + var ret string + return ret + } + return *o.Host +} + +// GetHostOk returns a tuple with the Host field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserResponse) GetHostOk() (*string, bool) { + if o == nil || IsNil(o.Host) { + return nil, false + } + return o.Host, true +} + +// HasHost returns a boolean if a field has been set. +func (o *UserResponse) HasHost() bool { + if o != nil && !IsNil(o.Host) { + return true + } + + return false +} + +// SetHost gets a reference to the given string and assigns it to the Host field. +func (o *UserResponse) SetHost(v string) { + o.Host = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *UserResponse) 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 *UserResponse) 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 *UserResponse) 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 *UserResponse) SetId(v string) { + o.Id = &v +} + +// GetPort returns the Port field value if set, zero value otherwise. +func (o *UserResponse) GetPort() int64 { + if o == nil || IsNil(o.Port) { + var ret int64 + return ret + } + return *o.Port +} + +// GetPortOk returns a tuple with the Port field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserResponse) GetPortOk() (*int64, bool) { + if o == nil || IsNil(o.Port) { + return nil, false + } + return o.Port, true +} + +// HasPort returns a boolean if a field has been set. +func (o *UserResponse) HasPort() bool { + if o != nil && !IsNil(o.Port) { + return true + } + + return false +} + +// SetPort gets a reference to the given int64 and assigns it to the Port field. +func (o *UserResponse) SetPort(v int64) { + o.Port = &v +} + +// GetRoles returns the Roles field value if set, zero value otherwise. +func (o *UserResponse) GetRoles() []string { + if o == nil || IsNil(o.Roles) { + var ret []string + return ret + } + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserResponse) GetRolesOk() ([]string, bool) { + if o == nil || IsNil(o.Roles) { + return nil, false + } + return o.Roles, true +} + +// HasRoles returns a boolean if a field has been set. +func (o *UserResponse) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { + return true + } + + return false +} + +// SetRoles gets a reference to the given []string and assigns it to the Roles field. +func (o *UserResponse) SetRoles(v []string) { + o.Roles = v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *UserResponse) GetUsername() string { + if o == nil || IsNil(o.Username) { + var ret string + return ret + } + return *o.Username +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserResponse) GetUsernameOk() (*string, bool) { + if o == nil || IsNil(o.Username) { + return nil, false + } + return o.Username, true +} + +// HasUsername returns a boolean if a field has been set. +func (o *UserResponse) HasUsername() bool { + if o != nil && !IsNil(o.Username) { + return true + } + + return false +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *UserResponse) SetUsername(v string) { + o.Username = &v +} + +func (o UserResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Host) { + toSerialize["host"] = o.Host + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Port) { + toSerialize["port"] = o.Port + } + if !IsNil(o.Roles) { + toSerialize["roles"] = o.Roles + } + if !IsNil(o.Username) { + toSerialize["username"] = o.Username + } + return toSerialize, nil +} + +type NullableUserResponse struct { + value *UserResponse + isSet bool +} + +func (v NullableUserResponse) Get() *UserResponse { + return v.value +} + +func (v *NullableUserResponse) Set(val *UserResponse) { + v.value = val + v.isSet = true +} + +func (v NullableUserResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableUserResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserResponse(val *UserResponse) *NullableUserResponse { + return &NullableUserResponse{value: val, isSet: true} +} + +func (v NullableUserResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/response.go b/services/postgresflex/v2api/response.go new file mode 100644 index 000000000..cf0b3bf94 --- /dev/null +++ b/services/postgresflex/v2api/response.go @@ -0,0 +1,48 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// 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/postgresflex/v2api/utils.go b/services/postgresflex/v2api/utils.go new file mode 100644 index 000000000..8fc5a7628 --- /dev/null +++ b/services/postgresflex/v2api/utils.go @@ -0,0 +1,362 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// 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/postgresflex/v3alpha1api/api_default.go b/services/postgresflex/v3alpha1api/api_default.go new file mode 100644 index 000000000..c89ce9ee5 --- /dev/null +++ b/services/postgresflex/v3alpha1api/api_default.go @@ -0,0 +1,6006 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v3alpha1api + +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 { + + /* + CloneRequest Clone Instance + + Clone Instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiCloneRequestRequest + */ + CloneRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCloneRequestRequest + + // CloneRequestExecute executes the request + // @return CloneResponse + CloneRequestExecute(r ApiCloneRequestRequest) (*CloneResponse, error) + + /* + CreateDatabaseRequest Create Database + + Create database for a user. Note: The name of a valid user must be provided in the 'options' map field using the key 'owner' + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiCreateDatabaseRequestRequest + */ + CreateDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCreateDatabaseRequestRequest + + // CreateDatabaseRequestExecute executes the request + // @return CreateDatabaseResponse + CreateDatabaseRequestExecute(r ApiCreateDatabaseRequestRequest) (*CreateDatabaseResponse, error) + + /* + CreateInstanceRequest Create Instance + + Create a new instance of a postgres database instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @return ApiCreateInstanceRequestRequest + */ + CreateInstanceRequest(ctx context.Context, projectId string, region string) ApiCreateInstanceRequestRequest + + // CreateInstanceRequestExecute executes the request + // @return CreateInstanceResponse + CreateInstanceRequestExecute(r ApiCreateInstanceRequestRequest) (*CreateInstanceResponse, error) + + /* + CreateUserRequest Create User + + Create user for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiCreateUserRequestRequest + */ + CreateUserRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCreateUserRequestRequest + + // CreateUserRequestExecute executes the request + // @return CreateUserResponse + CreateUserRequestExecute(r ApiCreateUserRequestRequest) (*CreateUserResponse, error) + + /* + DeleteDatabaseRequest Delete Database + + Delete database for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param databaseId The ID of the database. + @return ApiDeleteDatabaseRequestRequest + */ + DeleteDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseId int32) ApiDeleteDatabaseRequestRequest + + // DeleteDatabaseRequestExecute executes the request + DeleteDatabaseRequestExecute(r ApiDeleteDatabaseRequestRequest) error + + /* + DeleteInstanceRequest Delete Instance + + Delete an available postgres instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiDeleteInstanceRequestRequest + */ + DeleteInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiDeleteInstanceRequestRequest + + // DeleteInstanceRequestExecute executes the request + DeleteInstanceRequestExecute(r ApiDeleteInstanceRequestRequest) error + + /* + DeleteUserRequest Delete User + + Delete an user from a specific instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param userId The ID of the user. + @return ApiDeleteUserRequestRequest + */ + DeleteUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiDeleteUserRequestRequest + + // DeleteUserRequestExecute executes the request + DeleteUserRequestExecute(r ApiDeleteUserRequestRequest) error + + /* + GetBackupRequest Get specific backup + + Get information about a specific backup for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param backupId The ID of the backup. + @return ApiGetBackupRequestRequest + */ + GetBackupRequest(ctx context.Context, projectId string, region string, instanceId string, backupId int32) ApiGetBackupRequestRequest + + // GetBackupRequestExecute executes the request + // @return GetBackupResponse + GetBackupRequestExecute(r ApiGetBackupRequestRequest) (*GetBackupResponse, error) + + /* + GetCollationsRequest Get Collations for an Instance + + Get available collations for an instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiGetCollationsRequestRequest + */ + GetCollationsRequest(ctx context.Context, projectId string, region string, instanceId string) ApiGetCollationsRequestRequest + + // GetCollationsRequestExecute executes the request + // @return GetCollationsResponse + GetCollationsRequestExecute(r ApiGetCollationsRequestRequest) (*GetCollationsResponse, error) + + /* + GetDatabaseRequest Get Specific Database + + Get information about a specific database in an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param databaseId The ID of the database. + @return ApiGetDatabaseRequestRequest + */ + GetDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseId int32) ApiGetDatabaseRequestRequest + + // GetDatabaseRequestExecute executes the request + // @return GetDatabaseResponse + GetDatabaseRequestExecute(r ApiGetDatabaseRequestRequest) (*GetDatabaseResponse, error) + + /* + GetFlavorsRequest Get Flavors + + Get all available flavors for a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @return ApiGetFlavorsRequestRequest + */ + GetFlavorsRequest(ctx context.Context, projectId string, region string) ApiGetFlavorsRequestRequest + + // GetFlavorsRequestExecute executes the request + // @return GetFlavorsResponse + GetFlavorsRequestExecute(r ApiGetFlavorsRequestRequest) (*GetFlavorsResponse, error) + + /* + GetInstanceRequest Get Specific Instance + + Get information about a specific available instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiGetInstanceRequestRequest + */ + GetInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiGetInstanceRequestRequest + + // GetInstanceRequestExecute executes the request + // @return GetInstanceResponse + GetInstanceRequestExecute(r ApiGetInstanceRequestRequest) (*GetInstanceResponse, error) + + /* + GetUserRequest Get User + + Get a specific available user for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param userId The ID of the user. + @return ApiGetUserRequestRequest + */ + GetUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiGetUserRequestRequest + + // GetUserRequestExecute executes the request + // @return GetUserResponse + GetUserRequestExecute(r ApiGetUserRequestRequest) (*GetUserResponse, error) + + /* + GetVersionsRequest Get Versions + + Get available postgres versions for the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @return ApiGetVersionsRequestRequest + */ + GetVersionsRequest(ctx context.Context, projectId string, region string) ApiGetVersionsRequestRequest + + // GetVersionsRequestExecute executes the request + // @return GetVersionsResponse + GetVersionsRequestExecute(r ApiGetVersionsRequestRequest) (*GetVersionsResponse, error) + + /* + ListBackupsRequest List backups + + List all backups which are available for a specific instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiListBackupsRequestRequest + */ + ListBackupsRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListBackupsRequestRequest + + // ListBackupsRequestExecute executes the request + // @return ListBackupResponse + ListBackupsRequestExecute(r ApiListBackupsRequestRequest) (*ListBackupResponse, error) + + /* + ListDatabasesRequest List Databases + + List available databases for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiListDatabasesRequestRequest + */ + ListDatabasesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabasesRequestRequest + + // ListDatabasesRequestExecute executes the request + // @return ListDatabasesResponse + ListDatabasesRequestExecute(r ApiListDatabasesRequestRequest) (*ListDatabasesResponse, error) + + /* + ListInstancesRequest List Instances + + List all available instances for your project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @return ApiListInstancesRequestRequest + */ + ListInstancesRequest(ctx context.Context, projectId string, region string) ApiListInstancesRequestRequest + + // ListInstancesRequestExecute executes the request + // @return ListInstancesResponse + ListInstancesRequestExecute(r ApiListInstancesRequestRequest) (*ListInstancesResponse, error) + + /* + ListRolesRequest List Roles + + List available roles for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiListRolesRequestRequest + */ + ListRolesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListRolesRequestRequest + + // ListRolesRequestExecute executes the request + // @return ListRolesResponse + ListRolesRequestExecute(r ApiListRolesRequestRequest) (*ListRolesResponse, error) + + /* + ListUsersRequest List Users + + List available users for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiListUsersRequestRequest + */ + ListUsersRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListUsersRequestRequest + + // ListUsersRequestExecute executes the request + // @return ListUserResponse + ListUsersRequestExecute(r ApiListUsersRequestRequest) (*ListUserResponse, error) + + /* + ProtectInstanceRequest Protect Instance + + Toggle the deletion protection for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiProtectInstanceRequestRequest + */ + ProtectInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiProtectInstanceRequestRequest + + // ProtectInstanceRequestExecute executes the request + // @return ProtectInstanceResponse + ProtectInstanceRequestExecute(r ApiProtectInstanceRequestRequest) (*ProtectInstanceResponse, error) + + /* + ResetUserRequest Reset User + + Reset an user from an specific instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param userId The ID of the user. + @return ApiResetUserRequestRequest + */ + ResetUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiResetUserRequestRequest + + // ResetUserRequestExecute executes the request + // @return ResetUserResponse + ResetUserRequestExecute(r ApiResetUserRequestRequest) (*ResetUserResponse, error) + + /* + UpdateDatabasePartiallyRequest Update Database partially + + Update a database partially in an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param databaseId The ID of the database. + @return ApiUpdateDatabasePartiallyRequestRequest + */ + UpdateDatabasePartiallyRequest(ctx context.Context, projectId string, region string, instanceId string, databaseId int32) ApiUpdateDatabasePartiallyRequestRequest + + // UpdateDatabasePartiallyRequestExecute executes the request + UpdateDatabasePartiallyRequestExecute(r ApiUpdateDatabasePartiallyRequestRequest) error + + /* + UpdateDatabaseRequest Update Database + + Update a database in an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param databaseId The ID of the database. + @return ApiUpdateDatabaseRequestRequest + */ + UpdateDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseId int32) ApiUpdateDatabaseRequestRequest + + // UpdateDatabaseRequestExecute executes the request + UpdateDatabaseRequestExecute(r ApiUpdateDatabaseRequestRequest) error + + /* + UpdateInstancePartiallyRequest Update Instance Partially + + Update an available instance of a postgres database. No fields are required. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiUpdateInstancePartiallyRequestRequest + */ + UpdateInstancePartiallyRequest(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstancePartiallyRequestRequest + + // UpdateInstancePartiallyRequestExecute executes the request + UpdateInstancePartiallyRequestExecute(r ApiUpdateInstancePartiallyRequestRequest) error + + /* + UpdateInstanceRequest Update Instance + + Updates an available instance of a postgres database + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiUpdateInstanceRequestRequest + */ + UpdateInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceRequestRequest + + // UpdateInstanceRequestExecute executes the request + UpdateInstanceRequestExecute(r ApiUpdateInstanceRequestRequest) error + + /* + UpdateUserPartiallyRequest Update User Partially + + Update an user partially for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param userId The ID of the user. + @return ApiUpdateUserPartiallyRequestRequest + */ + UpdateUserPartiallyRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiUpdateUserPartiallyRequestRequest + + // UpdateUserPartiallyRequestExecute executes the request + UpdateUserPartiallyRequestExecute(r ApiUpdateUserPartiallyRequestRequest) error + + /* + UpdateUserRequest Update User + + Update user for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param userId The ID of the user. + @return ApiUpdateUserRequestRequest + */ + UpdateUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiUpdateUserRequestRequest + + // UpdateUserRequestExecute executes the request + UpdateUserRequestExecute(r ApiUpdateUserRequestRequest) error +} + +// DefaultAPIService DefaultAPI service +type DefaultAPIService service + +type ApiCloneRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + cloneRequestPayload *CloneRequestPayload +} + +// The request body with the parameters for cloning an instance by a point in time into a new instance. +func (r ApiCloneRequestRequest) CloneRequestPayload(cloneRequestPayload CloneRequestPayload) ApiCloneRequestRequest { + r.cloneRequestPayload = &cloneRequestPayload + return r +} + +func (r ApiCloneRequestRequest) Execute() (*CloneResponse, error) { + return r.ApiService.CloneRequestExecute(r) +} + +/* +CloneRequest Clone Instance + +Clone Instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiCloneRequestRequest +*/ +func (a *DefaultAPIService) CloneRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCloneRequestRequest { + return ApiCloneRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return CloneResponse +func (a *DefaultAPIService) CloneRequestExecute(r ApiCloneRequestRequest) (*CloneResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CloneResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CloneRequest") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/clone" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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.cloneRequestPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 501 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateDatabaseRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + createDatabaseRequestPayload *CreateDatabaseRequestPayload +} + +// The request body containing the information for the new database. +func (r ApiCreateDatabaseRequestRequest) CreateDatabaseRequestPayload(createDatabaseRequestPayload CreateDatabaseRequestPayload) ApiCreateDatabaseRequestRequest { + r.createDatabaseRequestPayload = &createDatabaseRequestPayload + return r +} + +func (r ApiCreateDatabaseRequestRequest) Execute() (*CreateDatabaseResponse, error) { + return r.ApiService.CreateDatabaseRequestExecute(r) +} + +/* +CreateDatabaseRequest Create Database + +Create database for a user. Note: The name of a valid user must be provided in the 'options' map field using the key 'owner' + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiCreateDatabaseRequestRequest +*/ +func (a *DefaultAPIService) CreateDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCreateDatabaseRequestRequest { + return ApiCreateDatabaseRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return CreateDatabaseResponse +func (a *DefaultAPIService) CreateDatabaseRequestExecute(r ApiCreateDatabaseRequestRequest) (*CreateDatabaseResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateDatabaseResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateDatabaseRequest") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/databases" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createDatabaseRequestPayload == nil { + return localVarReturnValue, reportError("createDatabaseRequestPayload 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.createDatabaseRequestPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = 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 == 412 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateInstanceRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + createInstanceRequestPayload *CreateInstanceRequestPayload +} + +// The request body with the parameters for the instance creation. Every parameter is required. +func (r ApiCreateInstanceRequestRequest) CreateInstanceRequestPayload(createInstanceRequestPayload CreateInstanceRequestPayload) ApiCreateInstanceRequestRequest { + r.createInstanceRequestPayload = &createInstanceRequestPayload + return r +} + +func (r ApiCreateInstanceRequestRequest) Execute() (*CreateInstanceResponse, error) { + return r.ApiService.CreateInstanceRequestExecute(r) +} + +/* +CreateInstanceRequest Create Instance + +Create a new instance of a postgres database instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @return ApiCreateInstanceRequestRequest +*/ +func (a *DefaultAPIService) CreateInstanceRequest(ctx context.Context, projectId string, region string) ApiCreateInstanceRequestRequest { + return ApiCreateInstanceRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return CreateInstanceResponse +func (a *DefaultAPIService) CreateInstanceRequestExecute(r ApiCreateInstanceRequestRequest) (*CreateInstanceResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateInstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateInstanceRequest") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3alpha1/projects/{projectId}/regions/{region}/instances" + 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 r.createInstanceRequestPayload == nil { + return localVarReturnValue, reportError("createInstanceRequestPayload 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.createInstanceRequestPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateUserRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + createUserRequestPayload *CreateUserRequestPayload +} + +// The request body containing the user details. +func (r ApiCreateUserRequestRequest) CreateUserRequestPayload(createUserRequestPayload CreateUserRequestPayload) ApiCreateUserRequestRequest { + r.createUserRequestPayload = &createUserRequestPayload + return r +} + +func (r ApiCreateUserRequestRequest) Execute() (*CreateUserResponse, error) { + return r.ApiService.CreateUserRequestExecute(r) +} + +/* +CreateUserRequest Create User + +Create user for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiCreateUserRequestRequest +*/ +func (a *DefaultAPIService) CreateUserRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCreateUserRequestRequest { + return ApiCreateUserRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return CreateUserResponse +func (a *DefaultAPIService) CreateUserRequestExecute(r ApiCreateUserRequestRequest) (*CreateUserResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateUserResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateUserRequest") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/users" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createUserRequestPayload == nil { + return localVarReturnValue, reportError("createUserRequestPayload 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.createUserRequestPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 412 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiDeleteDatabaseRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + databaseId int32 +} + +func (r ApiDeleteDatabaseRequestRequest) Execute() error { + return r.ApiService.DeleteDatabaseRequestExecute(r) +} + +/* +DeleteDatabaseRequest Delete Database + +Delete database for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param databaseId The ID of the database. + @return ApiDeleteDatabaseRequestRequest +*/ +func (a *DefaultAPIService) DeleteDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseId int32) ApiDeleteDatabaseRequestRequest { + return ApiDeleteDatabaseRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + databaseId: databaseId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteDatabaseRequestExecute(r ApiDeleteDatabaseRequestRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteDatabaseRequest") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/databases/{databaseId}" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"databaseId"+"}", url.PathEscape(parameterValueToString(r.databaseId, "databaseId")), -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 err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, 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 == 412 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != 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 ApiDeleteInstanceRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string +} + +func (r ApiDeleteInstanceRequestRequest) Execute() error { + return r.ApiService.DeleteInstanceRequestExecute(r) +} + +/* +DeleteInstanceRequest Delete Instance + +Delete an available postgres instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiDeleteInstanceRequestRequest +*/ +func (a *DefaultAPIService) DeleteInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiDeleteInstanceRequestRequest { + return ApiDeleteInstanceRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteInstanceRequestExecute(r ApiDeleteInstanceRequestRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteInstanceRequest") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -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 err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, 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 == 412 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != 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 ApiDeleteUserRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + userId int32 +} + +func (r ApiDeleteUserRequestRequest) Execute() error { + return r.ApiService.DeleteUserRequestExecute(r) +} + +/* +DeleteUserRequest Delete User + +Delete an user from a specific instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param userId The ID of the user. + @return ApiDeleteUserRequestRequest +*/ +func (a *DefaultAPIService) DeleteUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiDeleteUserRequestRequest { + return ApiDeleteUserRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + userId: userId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteUserRequestExecute(r ApiDeleteUserRequestRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteUserRequest") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -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 err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, 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 == 412 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != 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 ApiGetBackupRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + backupId int32 +} + +func (r ApiGetBackupRequestRequest) Execute() (*GetBackupResponse, error) { + return r.ApiService.GetBackupRequestExecute(r) +} + +/* +GetBackupRequest Get specific backup + +Get information about a specific backup for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param backupId The ID of the backup. + @return ApiGetBackupRequestRequest +*/ +func (a *DefaultAPIService) GetBackupRequest(ctx context.Context, projectId string, region string, instanceId string, backupId int32) ApiGetBackupRequestRequest { + return ApiGetBackupRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + backupId: backupId, + } +} + +// Execute executes the request +// +// @return GetBackupResponse +func (a *DefaultAPIService) GetBackupRequestExecute(r ApiGetBackupRequestRequest) (*GetBackupResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetBackupResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetBackupRequest") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -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 + } + if localVarHTTPResponse.StatusCode == 501 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetCollationsRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string +} + +func (r ApiGetCollationsRequestRequest) Execute() (*GetCollationsResponse, error) { + return r.ApiService.GetCollationsRequestExecute(r) +} + +/* +GetCollationsRequest Get Collations for an Instance + +Get available collations for an instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiGetCollationsRequestRequest +*/ +func (a *DefaultAPIService) GetCollationsRequest(ctx context.Context, projectId string, region string, instanceId string) ApiGetCollationsRequestRequest { + return ApiGetCollationsRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return GetCollationsResponse +func (a *DefaultAPIService) GetCollationsRequestExecute(r ApiGetCollationsRequestRequest) (*GetCollationsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetCollationsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetCollationsRequest") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/collations" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -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 + } + if localVarHTTPResponse.StatusCode == 501 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetDatabaseRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + databaseId int32 +} + +func (r ApiGetDatabaseRequestRequest) Execute() (*GetDatabaseResponse, error) { + return r.ApiService.GetDatabaseRequestExecute(r) +} + +/* +GetDatabaseRequest Get Specific Database + +Get information about a specific database in an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param databaseId The ID of the database. + @return ApiGetDatabaseRequestRequest +*/ +func (a *DefaultAPIService) GetDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseId int32) ApiGetDatabaseRequestRequest { + return ApiGetDatabaseRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + databaseId: databaseId, + } +} + +// Execute executes the request +// +// @return GetDatabaseResponse +func (a *DefaultAPIService) GetDatabaseRequestExecute(r ApiGetDatabaseRequestRequest) (*GetDatabaseResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetDatabaseResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetDatabaseRequest") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/databases/{databaseId}" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"databaseId"+"}", url.PathEscape(parameterValueToString(r.databaseId, "databaseId")), -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 ApiGetFlavorsRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + page *int32 + size *int32 + sort *FlavorSort +} + +// Number of the page of items list to be returned. +func (r ApiGetFlavorsRequestRequest) Page(page int32) ApiGetFlavorsRequestRequest { + r.page = &page + return r +} + +// Number of items to be returned on each page. +func (r ApiGetFlavorsRequestRequest) Size(size int32) ApiGetFlavorsRequestRequest { + r.size = &size + return r +} + +// Sorting of the flavors to be returned on each page. +func (r ApiGetFlavorsRequestRequest) Sort(sort FlavorSort) ApiGetFlavorsRequestRequest { + r.sort = &sort + return r +} + +func (r ApiGetFlavorsRequestRequest) Execute() (*GetFlavorsResponse, error) { + return r.ApiService.GetFlavorsRequestExecute(r) +} + +/* +GetFlavorsRequest Get Flavors + +Get all available flavors for a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @return ApiGetFlavorsRequestRequest +*/ +func (a *DefaultAPIService) GetFlavorsRequest(ctx context.Context, projectId string, region string) ApiGetFlavorsRequestRequest { + return ApiGetFlavorsRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return GetFlavorsResponse +func (a *DefaultAPIService) GetFlavorsRequestExecute(r ApiGetFlavorsRequestRequest) (*GetFlavorsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetFlavorsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetFlavorsRequest") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3alpha1/projects/{projectId}/regions/{region}/flavors" + 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 r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } else { + var defaultValue int32 = 1 + parameterAddToHeaderOrQuery(localVarQueryParams, "page", defaultValue, "form", "") + r.page = &defaultValue + } + if r.size != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "form", "") + } else { + var defaultValue int32 = 10 + parameterAddToHeaderOrQuery(localVarQueryParams, "size", defaultValue, "form", "") + r.size = &defaultValue + } + if r.sort != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sort", r.sort, "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 + } + if localVarHTTPResponse.StatusCode == 501 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetInstanceRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string +} + +func (r ApiGetInstanceRequestRequest) Execute() (*GetInstanceResponse, error) { + return r.ApiService.GetInstanceRequestExecute(r) +} + +/* +GetInstanceRequest Get Specific Instance + +Get information about a specific available instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiGetInstanceRequestRequest +*/ +func (a *DefaultAPIService) GetInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiGetInstanceRequestRequest { + return ApiGetInstanceRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return GetInstanceResponse +func (a *DefaultAPIService) GetInstanceRequestExecute(r ApiGetInstanceRequestRequest) (*GetInstanceResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetInstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetInstanceRequest") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -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 ApiGetUserRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + userId int32 +} + +func (r ApiGetUserRequestRequest) Execute() (*GetUserResponse, error) { + return r.ApiService.GetUserRequestExecute(r) +} + +/* +GetUserRequest Get User + +Get a specific available user for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param userId The ID of the user. + @return ApiGetUserRequestRequest +*/ +func (a *DefaultAPIService) GetUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiGetUserRequestRequest { + return ApiGetUserRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + userId: userId, + } +} + +// Execute executes the request +// +// @return GetUserResponse +func (a *DefaultAPIService) GetUserRequestExecute(r ApiGetUserRequestRequest) (*GetUserResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetUserResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetUserRequest") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -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 ApiGetVersionsRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string +} + +func (r ApiGetVersionsRequestRequest) Execute() (*GetVersionsResponse, error) { + return r.ApiService.GetVersionsRequestExecute(r) +} + +/* +GetVersionsRequest Get Versions + +Get available postgres versions for the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @return ApiGetVersionsRequestRequest +*/ +func (a *DefaultAPIService) GetVersionsRequest(ctx context.Context, projectId string, region string) ApiGetVersionsRequestRequest { + return ApiGetVersionsRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return GetVersionsResponse +func (a *DefaultAPIService) GetVersionsRequestExecute(r ApiGetVersionsRequestRequest) (*GetVersionsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetVersionsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetVersionsRequest") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3alpha1/projects/{projectId}/regions/{region}/versions" + 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{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(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 + } + if localVarHTTPResponse.StatusCode == 501 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListBackupsRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + page *int32 + size *int32 + sort *BackupSort +} + +// Number of the page of items list to be returned. +func (r ApiListBackupsRequestRequest) Page(page int32) ApiListBackupsRequestRequest { + r.page = &page + return r +} + +// Number of items to be returned on each page. +func (r ApiListBackupsRequestRequest) Size(size int32) ApiListBackupsRequestRequest { + r.size = &size + return r +} + +// Sorting of the backups to be returned on each page. +func (r ApiListBackupsRequestRequest) Sort(sort BackupSort) ApiListBackupsRequestRequest { + r.sort = &sort + return r +} + +func (r ApiListBackupsRequestRequest) Execute() (*ListBackupResponse, error) { + return r.ApiService.ListBackupsRequestExecute(r) +} + +/* +ListBackupsRequest List backups + +List all backups which are available for a specific instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiListBackupsRequestRequest +*/ +func (a *DefaultAPIService) ListBackupsRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListBackupsRequestRequest { + return ApiListBackupsRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListBackupResponse +func (a *DefaultAPIService) ListBackupsRequestExecute(r ApiListBackupsRequestRequest) (*ListBackupResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListBackupResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListBackupsRequest") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/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) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } else { + var defaultValue int32 = 1 + parameterAddToHeaderOrQuery(localVarQueryParams, "page", defaultValue, "form", "") + r.page = &defaultValue + } + if r.size != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "form", "") + } else { + var defaultValue int32 = 10 + parameterAddToHeaderOrQuery(localVarQueryParams, "size", defaultValue, "form", "") + r.size = &defaultValue + } + if r.sort != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sort", r.sort, "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 + } + if localVarHTTPResponse.StatusCode == 501 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListDatabasesRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + page *int32 + size *int32 + sort *DatabaseSort +} + +// Number of the page of items list to be returned. +func (r ApiListDatabasesRequestRequest) Page(page int32) ApiListDatabasesRequestRequest { + r.page = &page + return r +} + +// Number of items to be returned on each page. +func (r ApiListDatabasesRequestRequest) Size(size int32) ApiListDatabasesRequestRequest { + r.size = &size + return r +} + +// Sorting of the databases to be returned on each page. +func (r ApiListDatabasesRequestRequest) Sort(sort DatabaseSort) ApiListDatabasesRequestRequest { + r.sort = &sort + return r +} + +func (r ApiListDatabasesRequestRequest) Execute() (*ListDatabasesResponse, error) { + return r.ApiService.ListDatabasesRequestExecute(r) +} + +/* +ListDatabasesRequest List Databases + +List available databases for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiListDatabasesRequestRequest +*/ +func (a *DefaultAPIService) ListDatabasesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabasesRequestRequest { + return ApiListDatabasesRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListDatabasesResponse +func (a *DefaultAPIService) ListDatabasesRequestExecute(r ApiListDatabasesRequestRequest) (*ListDatabasesResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListDatabasesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListDatabasesRequest") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/databases" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } else { + var defaultValue int32 = 1 + parameterAddToHeaderOrQuery(localVarQueryParams, "page", defaultValue, "form", "") + r.page = &defaultValue + } + if r.size != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "form", "") + } else { + var defaultValue int32 = 10 + parameterAddToHeaderOrQuery(localVarQueryParams, "size", defaultValue, "form", "") + r.size = &defaultValue + } + if r.sort != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sort", r.sort, "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 ApiListInstancesRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + page *int32 + size *int32 + sort *InstanceSort +} + +// Number of the page of items list to be returned. +func (r ApiListInstancesRequestRequest) Page(page int32) ApiListInstancesRequestRequest { + r.page = &page + return r +} + +// Number of items to be returned on each page. +func (r ApiListInstancesRequestRequest) Size(size int32) ApiListInstancesRequestRequest { + r.size = &size + return r +} + +// Sorting of the items to be returned on each page. +func (r ApiListInstancesRequestRequest) Sort(sort InstanceSort) ApiListInstancesRequestRequest { + r.sort = &sort + return r +} + +func (r ApiListInstancesRequestRequest) Execute() (*ListInstancesResponse, error) { + return r.ApiService.ListInstancesRequestExecute(r) +} + +/* +ListInstancesRequest List Instances + +List all available instances for your project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @return ApiListInstancesRequestRequest +*/ +func (a *DefaultAPIService) ListInstancesRequest(ctx context.Context, projectId string, region string) ApiListInstancesRequestRequest { + return ApiListInstancesRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return ListInstancesResponse +func (a *DefaultAPIService) ListInstancesRequestExecute(r ApiListInstancesRequestRequest) (*ListInstancesResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListInstancesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListInstancesRequest") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3alpha1/projects/{projectId}/regions/{region}/instances" + 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 r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } else { + var defaultValue int32 = 1 + parameterAddToHeaderOrQuery(localVarQueryParams, "page", defaultValue, "form", "") + r.page = &defaultValue + } + if r.size != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "form", "") + } else { + var defaultValue int32 = 10 + parameterAddToHeaderOrQuery(localVarQueryParams, "size", defaultValue, "form", "") + r.size = &defaultValue + } + if r.sort != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sort", r.sort, "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 ApiListRolesRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string +} + +func (r ApiListRolesRequestRequest) Execute() (*ListRolesResponse, error) { + return r.ApiService.ListRolesRequestExecute(r) +} + +/* +ListRolesRequest List Roles + +List available roles for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiListRolesRequestRequest +*/ +func (a *DefaultAPIService) ListRolesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListRolesRequestRequest { + return ApiListRolesRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListRolesResponse +func (a *DefaultAPIService) ListRolesRequestExecute(r ApiListRolesRequestRequest) (*ListRolesResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListRolesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListRolesRequest") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/roles" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -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 ApiListUsersRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + page *int32 + size *int32 + sort *UserSort +} + +// Number of the page of items list to be returned. +func (r ApiListUsersRequestRequest) Page(page int32) ApiListUsersRequestRequest { + r.page = &page + return r +} + +// Number of items to be returned on each page. +func (r ApiListUsersRequestRequest) Size(size int32) ApiListUsersRequestRequest { + r.size = &size + return r +} + +// Sorting of the users to be returned on each page. +func (r ApiListUsersRequestRequest) Sort(sort UserSort) ApiListUsersRequestRequest { + r.sort = &sort + return r +} + +func (r ApiListUsersRequestRequest) Execute() (*ListUserResponse, error) { + return r.ApiService.ListUsersRequestExecute(r) +} + +/* +ListUsersRequest List Users + +List available users for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiListUsersRequestRequest +*/ +func (a *DefaultAPIService) ListUsersRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListUsersRequestRequest { + return ApiListUsersRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListUserResponse +func (a *DefaultAPIService) ListUsersRequestExecute(r ApiListUsersRequestRequest) (*ListUserResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListUserResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListUsersRequest") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/users" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } else { + var defaultValue int32 = 1 + parameterAddToHeaderOrQuery(localVarQueryParams, "page", defaultValue, "form", "") + r.page = &defaultValue + } + if r.size != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "form", "") + } else { + var defaultValue int32 = 10 + parameterAddToHeaderOrQuery(localVarQueryParams, "size", defaultValue, "form", "") + r.size = &defaultValue + } + if r.sort != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sort", r.sort, "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 ApiProtectInstanceRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + protectInstanceRequestPayload *ProtectInstanceRequestPayload +} + +// The request body with flag isDeletable. Parameter is required. +func (r ApiProtectInstanceRequestRequest) ProtectInstanceRequestPayload(protectInstanceRequestPayload ProtectInstanceRequestPayload) ApiProtectInstanceRequestRequest { + r.protectInstanceRequestPayload = &protectInstanceRequestPayload + return r +} + +func (r ApiProtectInstanceRequestRequest) Execute() (*ProtectInstanceResponse, error) { + return r.ApiService.ProtectInstanceRequestExecute(r) +} + +/* +ProtectInstanceRequest Protect Instance + +Toggle the deletion protection for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiProtectInstanceRequestRequest +*/ +func (a *DefaultAPIService) ProtectInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiProtectInstanceRequestRequest { + return ApiProtectInstanceRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ProtectInstanceResponse +func (a *DefaultAPIService) ProtectInstanceRequestExecute(r ApiProtectInstanceRequestRequest) (*ProtectInstanceResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ProtectInstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ProtectInstanceRequest") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/protections" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.protectInstanceRequestPayload == nil { + return localVarReturnValue, reportError("protectInstanceRequestPayload 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.protectInstanceRequestPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 501 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiResetUserRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + userId int32 +} + +func (r ApiResetUserRequestRequest) Execute() (*ResetUserResponse, error) { + return r.ApiService.ResetUserRequestExecute(r) +} + +/* +ResetUserRequest Reset User + +Reset an user from an specific instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param userId The ID of the user. + @return ApiResetUserRequestRequest +*/ +func (a *DefaultAPIService) ResetUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiResetUserRequestRequest { + return ApiResetUserRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + userId: userId, + } +} + +// Execute executes the request +// +// @return ResetUserResponse +func (a *DefaultAPIService) ResetUserRequestExecute(r ApiResetUserRequestRequest) (*ResetUserResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ResetUserResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ResetUserRequest") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}/reset" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -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 == 412 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateDatabasePartiallyRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + databaseId int32 + updateDatabasePartiallyRequestPayload *UpdateDatabasePartiallyRequestPayload +} + +// The request body containing the information for the database update. +func (r ApiUpdateDatabasePartiallyRequestRequest) UpdateDatabasePartiallyRequestPayload(updateDatabasePartiallyRequestPayload UpdateDatabasePartiallyRequestPayload) ApiUpdateDatabasePartiallyRequestRequest { + r.updateDatabasePartiallyRequestPayload = &updateDatabasePartiallyRequestPayload + return r +} + +func (r ApiUpdateDatabasePartiallyRequestRequest) Execute() error { + return r.ApiService.UpdateDatabasePartiallyRequestExecute(r) +} + +/* +UpdateDatabasePartiallyRequest Update Database partially + +Update a database partially in an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param databaseId The ID of the database. + @return ApiUpdateDatabasePartiallyRequestRequest +*/ +func (a *DefaultAPIService) UpdateDatabasePartiallyRequest(ctx context.Context, projectId string, region string, instanceId string, databaseId int32) ApiUpdateDatabasePartiallyRequestRequest { + return ApiUpdateDatabasePartiallyRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + databaseId: databaseId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) UpdateDatabasePartiallyRequestExecute(r ApiUpdateDatabasePartiallyRequestRequest) error { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateDatabasePartiallyRequest") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/databases/{databaseId}" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"databaseId"+"}", url.PathEscape(parameterValueToString(r.databaseId, "databaseId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateDatabasePartiallyRequestPayload == nil { + return reportError("updateDatabasePartiallyRequestPayload 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.updateDatabasePartiallyRequestPayload + 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 == 412 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != 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 ApiUpdateDatabaseRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + databaseId int32 + updateDatabaseRequestPayload *UpdateDatabaseRequestPayload +} + +// The request body containing the information for the database update. +func (r ApiUpdateDatabaseRequestRequest) UpdateDatabaseRequestPayload(updateDatabaseRequestPayload UpdateDatabaseRequestPayload) ApiUpdateDatabaseRequestRequest { + r.updateDatabaseRequestPayload = &updateDatabaseRequestPayload + return r +} + +func (r ApiUpdateDatabaseRequestRequest) Execute() error { + return r.ApiService.UpdateDatabaseRequestExecute(r) +} + +/* +UpdateDatabaseRequest Update Database + +Update a database in an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param databaseId The ID of the database. + @return ApiUpdateDatabaseRequestRequest +*/ +func (a *DefaultAPIService) UpdateDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseId int32) ApiUpdateDatabaseRequestRequest { + return ApiUpdateDatabaseRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + databaseId: databaseId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) UpdateDatabaseRequestExecute(r ApiUpdateDatabaseRequestRequest) error { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateDatabaseRequest") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/databases/{databaseId}" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"databaseId"+"}", url.PathEscape(parameterValueToString(r.databaseId, "databaseId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateDatabaseRequestPayload == nil { + return reportError("updateDatabaseRequestPayload 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.updateDatabaseRequestPayload + 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 == 412 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != 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 ApiUpdateInstancePartiallyRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + updateInstancePartiallyRequestPayload *UpdateInstancePartiallyRequestPayload +} + +// The request body with the parameters for updating the instance. +func (r ApiUpdateInstancePartiallyRequestRequest) UpdateInstancePartiallyRequestPayload(updateInstancePartiallyRequestPayload UpdateInstancePartiallyRequestPayload) ApiUpdateInstancePartiallyRequestRequest { + r.updateInstancePartiallyRequestPayload = &updateInstancePartiallyRequestPayload + return r +} + +func (r ApiUpdateInstancePartiallyRequestRequest) Execute() error { + return r.ApiService.UpdateInstancePartiallyRequestExecute(r) +} + +/* +UpdateInstancePartiallyRequest Update Instance Partially + +Update an available instance of a postgres database. No fields are required. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiUpdateInstancePartiallyRequestRequest +*/ +func (a *DefaultAPIService) UpdateInstancePartiallyRequest(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstancePartiallyRequestRequest { + return ApiUpdateInstancePartiallyRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) UpdateInstancePartiallyRequestExecute(r ApiUpdateInstancePartiallyRequestRequest) error { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateInstancePartiallyRequest") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateInstancePartiallyRequestPayload == nil { + return reportError("updateInstancePartiallyRequestPayload 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.updateInstancePartiallyRequestPayload + 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 == 412 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != 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 ApiUpdateInstanceRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + updateInstanceRequestPayload *UpdateInstanceRequestPayload +} + +// The request body with the parameters for updating the instance +func (r ApiUpdateInstanceRequestRequest) UpdateInstanceRequestPayload(updateInstanceRequestPayload UpdateInstanceRequestPayload) ApiUpdateInstanceRequestRequest { + r.updateInstanceRequestPayload = &updateInstanceRequestPayload + return r +} + +func (r ApiUpdateInstanceRequestRequest) Execute() error { + return r.ApiService.UpdateInstanceRequestExecute(r) +} + +/* +UpdateInstanceRequest Update Instance + +Updates an available instance of a postgres database + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiUpdateInstanceRequestRequest +*/ +func (a *DefaultAPIService) UpdateInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceRequestRequest { + return ApiUpdateInstanceRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) UpdateInstanceRequestExecute(r ApiUpdateInstanceRequestRequest) error { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateInstanceRequest") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateInstanceRequestPayload == nil { + return reportError("updateInstanceRequestPayload 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.updateInstanceRequestPayload + 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 == 412 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != 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 ApiUpdateUserPartiallyRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + userId int32 + updateUserPartiallyRequestPayload *UpdateUserPartiallyRequestPayload +} + +// The Request body containing the new information for the user. If empty request body is send via patch, then login and createdb roles are removed from user. +func (r ApiUpdateUserPartiallyRequestRequest) UpdateUserPartiallyRequestPayload(updateUserPartiallyRequestPayload UpdateUserPartiallyRequestPayload) ApiUpdateUserPartiallyRequestRequest { + r.updateUserPartiallyRequestPayload = &updateUserPartiallyRequestPayload + return r +} + +func (r ApiUpdateUserPartiallyRequestRequest) Execute() error { + return r.ApiService.UpdateUserPartiallyRequestExecute(r) +} + +/* +UpdateUserPartiallyRequest Update User Partially + +Update an user partially for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param userId The ID of the user. + @return ApiUpdateUserPartiallyRequestRequest +*/ +func (a *DefaultAPIService) UpdateUserPartiallyRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiUpdateUserPartiallyRequestRequest { + return ApiUpdateUserPartiallyRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + userId: userId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) UpdateUserPartiallyRequestExecute(r ApiUpdateUserPartiallyRequestRequest) error { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateUserPartiallyRequest") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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.updateUserPartiallyRequestPayload + 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 == 412 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != 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 ApiUpdateUserRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + userId int32 + updateUserRequestPayload *UpdateUserRequestPayload +} + +// The Request body containing the updated infos for the user. +func (r ApiUpdateUserRequestRequest) UpdateUserRequestPayload(updateUserRequestPayload UpdateUserRequestPayload) ApiUpdateUserRequestRequest { + r.updateUserRequestPayload = &updateUserRequestPayload + return r +} + +func (r ApiUpdateUserRequestRequest) Execute() error { + return r.ApiService.UpdateUserRequestExecute(r) +} + +/* +UpdateUserRequest Update User + +Update user for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param userId The ID of the user. + @return ApiUpdateUserRequestRequest +*/ +func (a *DefaultAPIService) UpdateUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiUpdateUserRequestRequest { + return ApiUpdateUserRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + userId: userId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) UpdateUserRequestExecute(r ApiUpdateUserRequestRequest) error { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateUserRequest") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}" + 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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateUserRequestPayload == nil { + return reportError("updateUserRequestPayload 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.updateUserRequestPayload + 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 == 412 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != 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 +} diff --git a/services/postgresflex/v3alpha1api/api_default_mock.go b/services/postgresflex/v3alpha1api/api_default_mock.go new file mode 100644 index 000000000..7664395f0 --- /dev/null +++ b/services/postgresflex/v3alpha1api/api_default_mock.go @@ -0,0 +1,615 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +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 { + // CloneRequestExecuteMock can be populated to implement the behavior of the CloneRequestExecute function of this mock + CloneRequestExecuteMock *func(r ApiCloneRequestRequest) (*CloneResponse, error) + // CreateDatabaseRequestExecuteMock can be populated to implement the behavior of the CreateDatabaseRequestExecute function of this mock + CreateDatabaseRequestExecuteMock *func(r ApiCreateDatabaseRequestRequest) (*CreateDatabaseResponse, error) + // CreateInstanceRequestExecuteMock can be populated to implement the behavior of the CreateInstanceRequestExecute function of this mock + CreateInstanceRequestExecuteMock *func(r ApiCreateInstanceRequestRequest) (*CreateInstanceResponse, error) + // CreateUserRequestExecuteMock can be populated to implement the behavior of the CreateUserRequestExecute function of this mock + CreateUserRequestExecuteMock *func(r ApiCreateUserRequestRequest) (*CreateUserResponse, error) + // DeleteDatabaseRequestExecuteMock can be populated to implement the behavior of the DeleteDatabaseRequestExecute function of this mock + DeleteDatabaseRequestExecuteMock *func(r ApiDeleteDatabaseRequestRequest) error + // DeleteInstanceRequestExecuteMock can be populated to implement the behavior of the DeleteInstanceRequestExecute function of this mock + DeleteInstanceRequestExecuteMock *func(r ApiDeleteInstanceRequestRequest) error + // DeleteUserRequestExecuteMock can be populated to implement the behavior of the DeleteUserRequestExecute function of this mock + DeleteUserRequestExecuteMock *func(r ApiDeleteUserRequestRequest) error + // GetBackupRequestExecuteMock can be populated to implement the behavior of the GetBackupRequestExecute function of this mock + GetBackupRequestExecuteMock *func(r ApiGetBackupRequestRequest) (*GetBackupResponse, error) + // GetCollationsRequestExecuteMock can be populated to implement the behavior of the GetCollationsRequestExecute function of this mock + GetCollationsRequestExecuteMock *func(r ApiGetCollationsRequestRequest) (*GetCollationsResponse, error) + // GetDatabaseRequestExecuteMock can be populated to implement the behavior of the GetDatabaseRequestExecute function of this mock + GetDatabaseRequestExecuteMock *func(r ApiGetDatabaseRequestRequest) (*GetDatabaseResponse, error) + // GetFlavorsRequestExecuteMock can be populated to implement the behavior of the GetFlavorsRequestExecute function of this mock + GetFlavorsRequestExecuteMock *func(r ApiGetFlavorsRequestRequest) (*GetFlavorsResponse, error) + // GetInstanceRequestExecuteMock can be populated to implement the behavior of the GetInstanceRequestExecute function of this mock + GetInstanceRequestExecuteMock *func(r ApiGetInstanceRequestRequest) (*GetInstanceResponse, error) + // GetUserRequestExecuteMock can be populated to implement the behavior of the GetUserRequestExecute function of this mock + GetUserRequestExecuteMock *func(r ApiGetUserRequestRequest) (*GetUserResponse, error) + // GetVersionsRequestExecuteMock can be populated to implement the behavior of the GetVersionsRequestExecute function of this mock + GetVersionsRequestExecuteMock *func(r ApiGetVersionsRequestRequest) (*GetVersionsResponse, error) + // ListBackupsRequestExecuteMock can be populated to implement the behavior of the ListBackupsRequestExecute function of this mock + ListBackupsRequestExecuteMock *func(r ApiListBackupsRequestRequest) (*ListBackupResponse, error) + // ListDatabasesRequestExecuteMock can be populated to implement the behavior of the ListDatabasesRequestExecute function of this mock + ListDatabasesRequestExecuteMock *func(r ApiListDatabasesRequestRequest) (*ListDatabasesResponse, error) + // ListInstancesRequestExecuteMock can be populated to implement the behavior of the ListInstancesRequestExecute function of this mock + ListInstancesRequestExecuteMock *func(r ApiListInstancesRequestRequest) (*ListInstancesResponse, error) + // ListRolesRequestExecuteMock can be populated to implement the behavior of the ListRolesRequestExecute function of this mock + ListRolesRequestExecuteMock *func(r ApiListRolesRequestRequest) (*ListRolesResponse, error) + // ListUsersRequestExecuteMock can be populated to implement the behavior of the ListUsersRequestExecute function of this mock + ListUsersRequestExecuteMock *func(r ApiListUsersRequestRequest) (*ListUserResponse, error) + // ProtectInstanceRequestExecuteMock can be populated to implement the behavior of the ProtectInstanceRequestExecute function of this mock + ProtectInstanceRequestExecuteMock *func(r ApiProtectInstanceRequestRequest) (*ProtectInstanceResponse, error) + // ResetUserRequestExecuteMock can be populated to implement the behavior of the ResetUserRequestExecute function of this mock + ResetUserRequestExecuteMock *func(r ApiResetUserRequestRequest) (*ResetUserResponse, error) + // UpdateDatabasePartiallyRequestExecuteMock can be populated to implement the behavior of the UpdateDatabasePartiallyRequestExecute function of this mock + UpdateDatabasePartiallyRequestExecuteMock *func(r ApiUpdateDatabasePartiallyRequestRequest) error + // UpdateDatabaseRequestExecuteMock can be populated to implement the behavior of the UpdateDatabaseRequestExecute function of this mock + UpdateDatabaseRequestExecuteMock *func(r ApiUpdateDatabaseRequestRequest) error + // UpdateInstancePartiallyRequestExecuteMock can be populated to implement the behavior of the UpdateInstancePartiallyRequestExecute function of this mock + UpdateInstancePartiallyRequestExecuteMock *func(r ApiUpdateInstancePartiallyRequestRequest) error + // UpdateInstanceRequestExecuteMock can be populated to implement the behavior of the UpdateInstanceRequestExecute function of this mock + UpdateInstanceRequestExecuteMock *func(r ApiUpdateInstanceRequestRequest) error + // UpdateUserPartiallyRequestExecuteMock can be populated to implement the behavior of the UpdateUserPartiallyRequestExecute function of this mock + UpdateUserPartiallyRequestExecuteMock *func(r ApiUpdateUserPartiallyRequestRequest) error + // UpdateUserRequestExecuteMock can be populated to implement the behavior of the UpdateUserRequestExecute function of this mock + UpdateUserRequestExecuteMock *func(r ApiUpdateUserRequestRequest) error +} + +func (a DefaultAPIServiceMock) CloneRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCloneRequestRequest { + return ApiCloneRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// CloneRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CloneRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CloneRequestExecute(r ApiCloneRequestRequest) (*CloneResponse, error) { + if a.CloneRequestExecuteMock == nil { + var localVarReturnValue *CloneResponse + return localVarReturnValue, nil + } + + return (*a.CloneRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCreateDatabaseRequestRequest { + return ApiCreateDatabaseRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// CreateDatabaseRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateDatabaseRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateDatabaseRequestExecute(r ApiCreateDatabaseRequestRequest) (*CreateDatabaseResponse, error) { + if a.CreateDatabaseRequestExecuteMock == nil { + var localVarReturnValue *CreateDatabaseResponse + return localVarReturnValue, nil + } + + return (*a.CreateDatabaseRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateInstanceRequest(ctx context.Context, projectId string, region string) ApiCreateInstanceRequestRequest { + return ApiCreateInstanceRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// CreateInstanceRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateInstanceRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateInstanceRequestExecute(r ApiCreateInstanceRequestRequest) (*CreateInstanceResponse, error) { + if a.CreateInstanceRequestExecuteMock == nil { + var localVarReturnValue *CreateInstanceResponse + return localVarReturnValue, nil + } + + return (*a.CreateInstanceRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateUserRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCreateUserRequestRequest { + return ApiCreateUserRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// CreateUserRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateUserRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateUserRequestExecute(r ApiCreateUserRequestRequest) (*CreateUserResponse, error) { + if a.CreateUserRequestExecuteMock == nil { + var localVarReturnValue *CreateUserResponse + return localVarReturnValue, nil + } + + return (*a.CreateUserRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseId int32) ApiDeleteDatabaseRequestRequest { + return ApiDeleteDatabaseRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + databaseId: databaseId, + } +} + +// DeleteDatabaseRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteDatabaseRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteDatabaseRequestExecute(r ApiDeleteDatabaseRequestRequest) error { + if a.DeleteDatabaseRequestExecuteMock == nil { + return nil + } + + return (*a.DeleteDatabaseRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiDeleteInstanceRequestRequest { + return ApiDeleteInstanceRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// DeleteInstanceRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteInstanceRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteInstanceRequestExecute(r ApiDeleteInstanceRequestRequest) error { + if a.DeleteInstanceRequestExecuteMock == nil { + return nil + } + + return (*a.DeleteInstanceRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiDeleteUserRequestRequest { + return ApiDeleteUserRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + userId: userId, + } +} + +// DeleteUserRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteUserRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteUserRequestExecute(r ApiDeleteUserRequestRequest) error { + if a.DeleteUserRequestExecuteMock == nil { + return nil + } + + return (*a.DeleteUserRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetBackupRequest(ctx context.Context, projectId string, region string, instanceId string, backupId int32) ApiGetBackupRequestRequest { + return ApiGetBackupRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + backupId: backupId, + } +} + +// GetBackupRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetBackupRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetBackupRequestExecute(r ApiGetBackupRequestRequest) (*GetBackupResponse, error) { + if a.GetBackupRequestExecuteMock == nil { + var localVarReturnValue *GetBackupResponse + return localVarReturnValue, nil + } + + return (*a.GetBackupRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetCollationsRequest(ctx context.Context, projectId string, region string, instanceId string) ApiGetCollationsRequestRequest { + return ApiGetCollationsRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// GetCollationsRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetCollationsRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetCollationsRequestExecute(r ApiGetCollationsRequestRequest) (*GetCollationsResponse, error) { + if a.GetCollationsRequestExecuteMock == nil { + var localVarReturnValue *GetCollationsResponse + return localVarReturnValue, nil + } + + return (*a.GetCollationsRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseId int32) ApiGetDatabaseRequestRequest { + return ApiGetDatabaseRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + databaseId: databaseId, + } +} + +// GetDatabaseRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetDatabaseRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetDatabaseRequestExecute(r ApiGetDatabaseRequestRequest) (*GetDatabaseResponse, error) { + if a.GetDatabaseRequestExecuteMock == nil { + var localVarReturnValue *GetDatabaseResponse + return localVarReturnValue, nil + } + + return (*a.GetDatabaseRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetFlavorsRequest(ctx context.Context, projectId string, region string) ApiGetFlavorsRequestRequest { + return ApiGetFlavorsRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// GetFlavorsRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetFlavorsRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetFlavorsRequestExecute(r ApiGetFlavorsRequestRequest) (*GetFlavorsResponse, error) { + if a.GetFlavorsRequestExecuteMock == nil { + var localVarReturnValue *GetFlavorsResponse + return localVarReturnValue, nil + } + + return (*a.GetFlavorsRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiGetInstanceRequestRequest { + return ApiGetInstanceRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// GetInstanceRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetInstanceRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetInstanceRequestExecute(r ApiGetInstanceRequestRequest) (*GetInstanceResponse, error) { + if a.GetInstanceRequestExecuteMock == nil { + var localVarReturnValue *GetInstanceResponse + return localVarReturnValue, nil + } + + return (*a.GetInstanceRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiGetUserRequestRequest { + return ApiGetUserRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + userId: userId, + } +} + +// GetUserRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetUserRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetUserRequestExecute(r ApiGetUserRequestRequest) (*GetUserResponse, error) { + if a.GetUserRequestExecuteMock == nil { + var localVarReturnValue *GetUserResponse + return localVarReturnValue, nil + } + + return (*a.GetUserRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetVersionsRequest(ctx context.Context, projectId string, region string) ApiGetVersionsRequestRequest { + return ApiGetVersionsRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// GetVersionsRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetVersionsRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetVersionsRequestExecute(r ApiGetVersionsRequestRequest) (*GetVersionsResponse, error) { + if a.GetVersionsRequestExecuteMock == nil { + var localVarReturnValue *GetVersionsResponse + return localVarReturnValue, nil + } + + return (*a.GetVersionsRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListBackupsRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListBackupsRequestRequest { + return ApiListBackupsRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// ListBackupsRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListBackupsRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListBackupsRequestExecute(r ApiListBackupsRequestRequest) (*ListBackupResponse, error) { + if a.ListBackupsRequestExecuteMock == nil { + var localVarReturnValue *ListBackupResponse + return localVarReturnValue, nil + } + + return (*a.ListBackupsRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListDatabasesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabasesRequestRequest { + return ApiListDatabasesRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// ListDatabasesRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListDatabasesRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListDatabasesRequestExecute(r ApiListDatabasesRequestRequest) (*ListDatabasesResponse, error) { + if a.ListDatabasesRequestExecuteMock == nil { + var localVarReturnValue *ListDatabasesResponse + return localVarReturnValue, nil + } + + return (*a.ListDatabasesRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListInstancesRequest(ctx context.Context, projectId string, region string) ApiListInstancesRequestRequest { + return ApiListInstancesRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// ListInstancesRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListInstancesRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListInstancesRequestExecute(r ApiListInstancesRequestRequest) (*ListInstancesResponse, error) { + if a.ListInstancesRequestExecuteMock == nil { + var localVarReturnValue *ListInstancesResponse + return localVarReturnValue, nil + } + + return (*a.ListInstancesRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListRolesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListRolesRequestRequest { + return ApiListRolesRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// ListRolesRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListRolesRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListRolesRequestExecute(r ApiListRolesRequestRequest) (*ListRolesResponse, error) { + if a.ListRolesRequestExecuteMock == nil { + var localVarReturnValue *ListRolesResponse + return localVarReturnValue, nil + } + + return (*a.ListRolesRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListUsersRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListUsersRequestRequest { + return ApiListUsersRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// ListUsersRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListUsersRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListUsersRequestExecute(r ApiListUsersRequestRequest) (*ListUserResponse, error) { + if a.ListUsersRequestExecuteMock == nil { + var localVarReturnValue *ListUserResponse + return localVarReturnValue, nil + } + + return (*a.ListUsersRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ProtectInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiProtectInstanceRequestRequest { + return ApiProtectInstanceRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// ProtectInstanceRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ProtectInstanceRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ProtectInstanceRequestExecute(r ApiProtectInstanceRequestRequest) (*ProtectInstanceResponse, error) { + if a.ProtectInstanceRequestExecuteMock == nil { + var localVarReturnValue *ProtectInstanceResponse + return localVarReturnValue, nil + } + + return (*a.ProtectInstanceRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ResetUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiResetUserRequestRequest { + return ApiResetUserRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + userId: userId, + } +} + +// ResetUserRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ResetUserRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ResetUserRequestExecute(r ApiResetUserRequestRequest) (*ResetUserResponse, error) { + if a.ResetUserRequestExecuteMock == nil { + var localVarReturnValue *ResetUserResponse + return localVarReturnValue, nil + } + + return (*a.ResetUserRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateDatabasePartiallyRequest(ctx context.Context, projectId string, region string, instanceId string, databaseId int32) ApiUpdateDatabasePartiallyRequestRequest { + return ApiUpdateDatabasePartiallyRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + databaseId: databaseId, + } +} + +// UpdateDatabasePartiallyRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateDatabasePartiallyRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateDatabasePartiallyRequestExecute(r ApiUpdateDatabasePartiallyRequestRequest) error { + if a.UpdateDatabasePartiallyRequestExecuteMock == nil { + return nil + } + + return (*a.UpdateDatabasePartiallyRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseId int32) ApiUpdateDatabaseRequestRequest { + return ApiUpdateDatabaseRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + databaseId: databaseId, + } +} + +// UpdateDatabaseRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateDatabaseRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateDatabaseRequestExecute(r ApiUpdateDatabaseRequestRequest) error { + if a.UpdateDatabaseRequestExecuteMock == nil { + return nil + } + + return (*a.UpdateDatabaseRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateInstancePartiallyRequest(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstancePartiallyRequestRequest { + return ApiUpdateInstancePartiallyRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// UpdateInstancePartiallyRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateInstancePartiallyRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateInstancePartiallyRequestExecute(r ApiUpdateInstancePartiallyRequestRequest) error { + if a.UpdateInstancePartiallyRequestExecuteMock == nil { + return nil + } + + return (*a.UpdateInstancePartiallyRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceRequestRequest { + return ApiUpdateInstanceRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// UpdateInstanceRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateInstanceRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateInstanceRequestExecute(r ApiUpdateInstanceRequestRequest) error { + if a.UpdateInstanceRequestExecuteMock == nil { + return nil + } + + return (*a.UpdateInstanceRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateUserPartiallyRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiUpdateUserPartiallyRequestRequest { + return ApiUpdateUserPartiallyRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + userId: userId, + } +} + +// UpdateUserPartiallyRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateUserPartiallyRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateUserPartiallyRequestExecute(r ApiUpdateUserPartiallyRequestRequest) error { + if a.UpdateUserPartiallyRequestExecuteMock == nil { + return nil + } + + return (*a.UpdateUserPartiallyRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiUpdateUserRequestRequest { + return ApiUpdateUserRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + userId: userId, + } +} + +// UpdateUserRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateUserRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateUserRequestExecute(r ApiUpdateUserRequestRequest) error { + if a.UpdateUserRequestExecuteMock == nil { + return nil + } + + return (*a.UpdateUserRequestExecuteMock)(r) +} diff --git a/services/postgresflex/v3alpha1api/client.go b/services/postgresflex/v3alpha1api/client.go new file mode 100644 index 000000000..15e78ba73 --- /dev/null +++ b/services/postgresflex/v3alpha1api/client.go @@ -0,0 +1,659 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v3alpha1api + +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 PostgreSQL Flex API API v3alpha1 +// 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/postgresflex/v3alpha1api/configuration.go b/services/postgresflex/v3alpha1api/configuration.go new file mode 100644 index 000000000..5f0ae5410 --- /dev/null +++ b/services/postgresflex/v3alpha1api/configuration.go @@ -0,0 +1,41 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v3alpha1api + +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/postgresflex", + Debug: false, + Servers: config.ServerConfigurations{ + { + URL: "https://postgres-flex-service.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/postgresflex/v3alpha1api/model_backup_sort.go b/services/postgresflex/v3alpha1api/model_backup_sort.go new file mode 100644 index 000000000..5aaf9fb69 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_backup_sort.go @@ -0,0 +1,131 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "encoding/json" + "fmt" +) + +// BackupSort the model 'BackupSort' +type BackupSort string + +// List of backup.sort +const ( + BACKUPSORT_COMPLETION_TIME_DESC BackupSort = "completion_time.desc" + BACKUPSORT_COMPLETION_TIME_ASC BackupSort = "completion_time.asc" + BACKUPSORT_END_TIME_DESC BackupSort = "end_time.desc" + BACKUPSORT_END_TIME_ASC BackupSort = "end_time.asc" + BACKUPSORT_NAME_DESC BackupSort = "name.desc" + BACKUPSORT_NAME_ASC BackupSort = "name.asc" + BACKUPSORT_RETAINED_UNTIL_DESC BackupSort = "retained_until.desc" + BACKUPSORT_RETAINED_UNTIL_ASC BackupSort = "retained_until.asc" + BACKUPSORT_SIZE_DESC BackupSort = "size.desc" + BACKUPSORT_SIZE_ASC BackupSort = "size.asc" + BACKUPSORT_TYPE_DESC BackupSort = "type.desc" + BACKUPSORT_TYPE_ASC BackupSort = "type.asc" +) + +// All allowed values of BackupSort enum +var AllowedBackupSortEnumValues = []BackupSort{ + "completion_time.desc", + "completion_time.asc", + "end_time.desc", + "end_time.asc", + "name.desc", + "name.asc", + "retained_until.desc", + "retained_until.asc", + "size.desc", + "size.asc", + "type.desc", + "type.asc", +} + +func (v *BackupSort) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := BackupSort(value) + for _, existing := range AllowedBackupSortEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid BackupSort", value) +} + +// NewBackupSortFromValue returns a pointer to a valid BackupSort +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewBackupSortFromValue(v string) (*BackupSort, error) { + ev := BackupSort(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for BackupSort: valid values are %v", v, AllowedBackupSortEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v BackupSort) IsValid() bool { + for _, existing := range AllowedBackupSortEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to backup.sort value +func (v BackupSort) Ptr() *BackupSort { + return &v +} + +type NullableBackupSort struct { + value *BackupSort + isSet bool +} + +func (v NullableBackupSort) Get() *BackupSort { + return v.value +} + +func (v *NullableBackupSort) Set(val *BackupSort) { + v.value = val + v.isSet = true +} + +func (v NullableBackupSort) IsSet() bool { + return v.isSet +} + +func (v *NullableBackupSort) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackupSort(val *BackupSort) *NullableBackupSort { + return &NullableBackupSort{value: val, isSet: true} +} + +func (v NullableBackupSort) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackupSort) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_clone_instance_overrides.go b/services/postgresflex/v3alpha1api/model_clone_instance_overrides.go new file mode 100644 index 000000000..210371869 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_clone_instance_overrides.go @@ -0,0 +1,187 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CloneInstanceOverrides type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CloneInstanceOverrides{} + +// CloneInstanceOverrides struct for CloneInstanceOverrides +type CloneInstanceOverrides struct { + // The storage class for the storage. + PerformanceClass string `json:"performanceClass"` + // The storage size in Gigabytes. + Size int32 `json:"size"` +} + +type _CloneInstanceOverrides CloneInstanceOverrides + +// NewCloneInstanceOverrides instantiates a new CloneInstanceOverrides object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCloneInstanceOverrides(performanceClass string, size int32) *CloneInstanceOverrides { + this := CloneInstanceOverrides{} + this.PerformanceClass = performanceClass + this.Size = size + return &this +} + +// NewCloneInstanceOverridesWithDefaults instantiates a new CloneInstanceOverrides object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCloneInstanceOverridesWithDefaults() *CloneInstanceOverrides { + this := CloneInstanceOverrides{} + return &this +} + +// GetPerformanceClass returns the PerformanceClass field value +func (o *CloneInstanceOverrides) GetPerformanceClass() string { + if o == nil { + var ret string + return ret + } + + return o.PerformanceClass +} + +// GetPerformanceClassOk returns a tuple with the PerformanceClass field value +// and a boolean to check if the value has been set. +func (o *CloneInstanceOverrides) GetPerformanceClassOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PerformanceClass, true +} + +// SetPerformanceClass sets field value +func (o *CloneInstanceOverrides) SetPerformanceClass(v string) { + o.PerformanceClass = v +} + +// GetSize returns the Size field value +func (o *CloneInstanceOverrides) GetSize() int32 { + if o == nil { + var ret int32 + 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 *CloneInstanceOverrides) GetSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value +func (o *CloneInstanceOverrides) SetSize(v int32) { + o.Size = v +} + +func (o CloneInstanceOverrides) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CloneInstanceOverrides) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["performanceClass"] = o.PerformanceClass + toSerialize["size"] = o.Size + return toSerialize, nil +} + +func (o *CloneInstanceOverrides) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "performanceClass", + "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) + } + } + + varCloneInstanceOverrides := _CloneInstanceOverrides{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCloneInstanceOverrides) + + if err != nil { + return err + } + + *o = CloneInstanceOverrides(varCloneInstanceOverrides) + + return err +} + +type NullableCloneInstanceOverrides struct { + value *CloneInstanceOverrides + isSet bool +} + +func (v NullableCloneInstanceOverrides) Get() *CloneInstanceOverrides { + return v.value +} + +func (v *NullableCloneInstanceOverrides) Set(val *CloneInstanceOverrides) { + v.value = val + v.isSet = true +} + +func (v NullableCloneInstanceOverrides) IsSet() bool { + return v.isSet +} + +func (v *NullableCloneInstanceOverrides) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCloneInstanceOverrides(val *CloneInstanceOverrides) *NullableCloneInstanceOverrides { + return &NullableCloneInstanceOverrides{value: val, isSet: true} +} + +func (v NullableCloneInstanceOverrides) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCloneInstanceOverrides) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_clone_request_payload.go b/services/postgresflex/v3alpha1api/model_clone_request_payload.go new file mode 100644 index 000000000..dec78924c --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_clone_request_payload.go @@ -0,0 +1,187 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the CloneRequestPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CloneRequestPayload{} + +// CloneRequestPayload struct for CloneRequestPayload +type CloneRequestPayload struct { + InstanceOverrides CloneInstanceOverrides `json:"instanceOverrides"` + // the time for the point in time recovery it will be calculated between first backup and last backup + PointInTime time.Time `json:"pointInTime"` +} + +type _CloneRequestPayload CloneRequestPayload + +// NewCloneRequestPayload instantiates a new CloneRequestPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCloneRequestPayload(instanceOverrides CloneInstanceOverrides, pointInTime time.Time) *CloneRequestPayload { + this := CloneRequestPayload{} + this.InstanceOverrides = instanceOverrides + this.PointInTime = pointInTime + return &this +} + +// NewCloneRequestPayloadWithDefaults instantiates a new CloneRequestPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCloneRequestPayloadWithDefaults() *CloneRequestPayload { + this := CloneRequestPayload{} + return &this +} + +// GetInstanceOverrides returns the InstanceOverrides field value +func (o *CloneRequestPayload) GetInstanceOverrides() CloneInstanceOverrides { + if o == nil { + var ret CloneInstanceOverrides + return ret + } + + return o.InstanceOverrides +} + +// GetInstanceOverridesOk returns a tuple with the InstanceOverrides field value +// and a boolean to check if the value has been set. +func (o *CloneRequestPayload) GetInstanceOverridesOk() (*CloneInstanceOverrides, bool) { + if o == nil { + return nil, false + } + return &o.InstanceOverrides, true +} + +// SetInstanceOverrides sets field value +func (o *CloneRequestPayload) SetInstanceOverrides(v CloneInstanceOverrides) { + o.InstanceOverrides = v +} + +// GetPointInTime returns the PointInTime field value +func (o *CloneRequestPayload) GetPointInTime() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.PointInTime +} + +// GetPointInTimeOk returns a tuple with the PointInTime field value +// and a boolean to check if the value has been set. +func (o *CloneRequestPayload) GetPointInTimeOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.PointInTime, true +} + +// SetPointInTime sets field value +func (o *CloneRequestPayload) SetPointInTime(v time.Time) { + o.PointInTime = v +} + +func (o CloneRequestPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CloneRequestPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instanceOverrides"] = o.InstanceOverrides + toSerialize["pointInTime"] = o.PointInTime + return toSerialize, nil +} + +func (o *CloneRequestPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "instanceOverrides", + "pointInTime", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCloneRequestPayload := _CloneRequestPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCloneRequestPayload) + + if err != nil { + return err + } + + *o = CloneRequestPayload(varCloneRequestPayload) + + return err +} + +type NullableCloneRequestPayload struct { + value *CloneRequestPayload + isSet bool +} + +func (v NullableCloneRequestPayload) Get() *CloneRequestPayload { + return v.value +} + +func (v *NullableCloneRequestPayload) Set(val *CloneRequestPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCloneRequestPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCloneRequestPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCloneRequestPayload(val *CloneRequestPayload) *NullableCloneRequestPayload { + return &NullableCloneRequestPayload{value: val, isSet: true} +} + +func (v NullableCloneRequestPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCloneRequestPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_clone_response.go b/services/postgresflex/v3alpha1api/model_clone_response.go new file mode 100644 index 000000000..5aaab43f5 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_clone_response.go @@ -0,0 +1,158 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CloneResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CloneResponse{} + +// CloneResponse struct for CloneResponse +type CloneResponse struct { + // The ID of the instance. + Id string `json:"id"` +} + +type _CloneResponse CloneResponse + +// NewCloneResponse instantiates a new CloneResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCloneResponse(id string) *CloneResponse { + this := CloneResponse{} + this.Id = id + return &this +} + +// NewCloneResponseWithDefaults instantiates a new CloneResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCloneResponseWithDefaults() *CloneResponse { + this := CloneResponse{} + return &this +} + +// GetId returns the Id field value +func (o *CloneResponse) 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 *CloneResponse) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CloneResponse) SetId(v string) { + o.Id = v +} + +func (o CloneResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CloneResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + return toSerialize, nil +} + +func (o *CloneResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCloneResponse := _CloneResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCloneResponse) + + if err != nil { + return err + } + + *o = CloneResponse(varCloneResponse) + + return err +} + +type NullableCloneResponse struct { + value *CloneResponse + isSet bool +} + +func (v NullableCloneResponse) Get() *CloneResponse { + return v.value +} + +func (v *NullableCloneResponse) Set(val *CloneResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCloneResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCloneResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCloneResponse(val *CloneResponse) *NullableCloneResponse { + return &NullableCloneResponse{value: val, isSet: true} +} + +func (v NullableCloneResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCloneResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_create_database_request_payload.go b/services/postgresflex/v3alpha1api/model_create_database_request_payload.go new file mode 100644 index 000000000..d693af3d8 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_create_database_request_payload.go @@ -0,0 +1,195 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateDatabaseRequestPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateDatabaseRequestPayload{} + +// CreateDatabaseRequestPayload struct for CreateDatabaseRequestPayload +type CreateDatabaseRequestPayload struct { + // The name of the database. + Name string `json:"name"` + // The owner of the database. + Owner *string `json:"owner,omitempty"` +} + +type _CreateDatabaseRequestPayload CreateDatabaseRequestPayload + +// NewCreateDatabaseRequestPayload instantiates a new CreateDatabaseRequestPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateDatabaseRequestPayload(name string) *CreateDatabaseRequestPayload { + this := CreateDatabaseRequestPayload{} + this.Name = name + return &this +} + +// NewCreateDatabaseRequestPayloadWithDefaults instantiates a new CreateDatabaseRequestPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateDatabaseRequestPayloadWithDefaults() *CreateDatabaseRequestPayload { + this := CreateDatabaseRequestPayload{} + return &this +} + +// GetName returns the Name field value +func (o *CreateDatabaseRequestPayload) 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 *CreateDatabaseRequestPayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateDatabaseRequestPayload) SetName(v string) { + o.Name = v +} + +// GetOwner returns the Owner field value if set, zero value otherwise. +func (o *CreateDatabaseRequestPayload) 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 *CreateDatabaseRequestPayload) 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 *CreateDatabaseRequestPayload) 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 *CreateDatabaseRequestPayload) SetOwner(v string) { + o.Owner = &v +} + +func (o CreateDatabaseRequestPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateDatabaseRequestPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Owner) { + toSerialize["owner"] = o.Owner + } + return toSerialize, nil +} + +func (o *CreateDatabaseRequestPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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) + } + } + + varCreateDatabaseRequestPayload := _CreateDatabaseRequestPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateDatabaseRequestPayload) + + if err != nil { + return err + } + + *o = CreateDatabaseRequestPayload(varCreateDatabaseRequestPayload) + + return err +} + +type NullableCreateDatabaseRequestPayload struct { + value *CreateDatabaseRequestPayload + isSet bool +} + +func (v NullableCreateDatabaseRequestPayload) Get() *CreateDatabaseRequestPayload { + return v.value +} + +func (v *NullableCreateDatabaseRequestPayload) Set(val *CreateDatabaseRequestPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateDatabaseRequestPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateDatabaseRequestPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateDatabaseRequestPayload(val *CreateDatabaseRequestPayload) *NullableCreateDatabaseRequestPayload { + return &NullableCreateDatabaseRequestPayload{value: val, isSet: true} +} + +func (v NullableCreateDatabaseRequestPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateDatabaseRequestPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_create_database_response.go b/services/postgresflex/v3alpha1api/model_create_database_response.go new file mode 100644 index 000000000..3476fdef8 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_create_database_response.go @@ -0,0 +1,158 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateDatabaseResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateDatabaseResponse{} + +// CreateDatabaseResponse struct for CreateDatabaseResponse +type CreateDatabaseResponse struct { + // The id of the database. + Id int32 `json:"id"` +} + +type _CreateDatabaseResponse CreateDatabaseResponse + +// NewCreateDatabaseResponse instantiates a new CreateDatabaseResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateDatabaseResponse(id int32) *CreateDatabaseResponse { + this := CreateDatabaseResponse{} + this.Id = id + return &this +} + +// NewCreateDatabaseResponseWithDefaults instantiates a new CreateDatabaseResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateDatabaseResponseWithDefaults() *CreateDatabaseResponse { + this := CreateDatabaseResponse{} + return &this +} + +// GetId returns the Id field value +func (o *CreateDatabaseResponse) GetId() int32 { + if o == nil { + var ret int32 + 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 *CreateDatabaseResponse) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CreateDatabaseResponse) SetId(v int32) { + o.Id = v +} + +func (o CreateDatabaseResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateDatabaseResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + return toSerialize, nil +} + +func (o *CreateDatabaseResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateDatabaseResponse := _CreateDatabaseResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateDatabaseResponse) + + if err != nil { + return err + } + + *o = CreateDatabaseResponse(varCreateDatabaseResponse) + + return err +} + +type NullableCreateDatabaseResponse struct { + value *CreateDatabaseResponse + isSet bool +} + +func (v NullableCreateDatabaseResponse) Get() *CreateDatabaseResponse { + return v.value +} + +func (v *NullableCreateDatabaseResponse) Set(val *CreateDatabaseResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCreateDatabaseResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateDatabaseResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateDatabaseResponse(val *CreateDatabaseResponse) *NullableCreateDatabaseResponse { + return &NullableCreateDatabaseResponse{value: val, isSet: true} +} + +func (v NullableCreateDatabaseResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateDatabaseResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_create_instance_request_payload.go b/services/postgresflex/v3alpha1api/model_create_instance_request_payload.go new file mode 100644 index 000000000..f360ffa06 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_create_instance_request_payload.go @@ -0,0 +1,394 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateInstanceRequestPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateInstanceRequestPayload{} + +// CreateInstanceRequestPayload struct for CreateInstanceRequestPayload +type CreateInstanceRequestPayload struct { + // The schedule for when the database backup will be created. Currently, ONLY daily schedules are supported (every 24 hours). The schedule is written as a cron schedule. + BackupSchedule string `json:"backupSchedule"` + Encryption *InstanceEncryption `json:"encryption,omitempty"` + // The id of the instance flavor. + FlavorId string `json:"flavorId"` + // The name of the instance. + Name string `json:"name"` + Network InstanceNetworkCreate `json:"network"` + Replicas Replicas `json:"replicas"` + // How long backups are retained. The value can only be between 32 and 365 days. + RetentionDays int32 `json:"retentionDays"` + Storage StorageCreate `json:"storage"` + // The Postgres version used for the instance. See [Versions Endpoint](/documentation/postgres-flex-service/version/v3alpha1#tag/Version) for supported version parameters. + Version string `json:"version"` +} + +type _CreateInstanceRequestPayload CreateInstanceRequestPayload + +// NewCreateInstanceRequestPayload instantiates a new CreateInstanceRequestPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateInstanceRequestPayload(backupSchedule string, flavorId string, name string, network InstanceNetworkCreate, replicas Replicas, retentionDays int32, storage StorageCreate, version string) *CreateInstanceRequestPayload { + this := CreateInstanceRequestPayload{} + this.BackupSchedule = backupSchedule + this.FlavorId = flavorId + this.Name = name + this.Network = network + this.Replicas = replicas + this.RetentionDays = retentionDays + this.Storage = storage + this.Version = version + return &this +} + +// NewCreateInstanceRequestPayloadWithDefaults instantiates a new CreateInstanceRequestPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateInstanceRequestPayloadWithDefaults() *CreateInstanceRequestPayload { + this := CreateInstanceRequestPayload{} + return &this +} + +// GetBackupSchedule returns the BackupSchedule field value +func (o *CreateInstanceRequestPayload) GetBackupSchedule() string { + if o == nil { + var ret string + return ret + } + + return o.BackupSchedule +} + +// GetBackupScheduleOk returns a tuple with the BackupSchedule field value +// and a boolean to check if the value has been set. +func (o *CreateInstanceRequestPayload) GetBackupScheduleOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BackupSchedule, true +} + +// SetBackupSchedule sets field value +func (o *CreateInstanceRequestPayload) SetBackupSchedule(v string) { + o.BackupSchedule = v +} + +// GetEncryption returns the Encryption field value if set, zero value otherwise. +func (o *CreateInstanceRequestPayload) GetEncryption() InstanceEncryption { + if o == nil || IsNil(o.Encryption) { + var ret InstanceEncryption + return ret + } + return *o.Encryption +} + +// GetEncryptionOk returns a tuple with the Encryption field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateInstanceRequestPayload) GetEncryptionOk() (*InstanceEncryption, bool) { + if o == nil || IsNil(o.Encryption) { + return nil, false + } + return o.Encryption, true +} + +// HasEncryption returns a boolean if a field has been set. +func (o *CreateInstanceRequestPayload) HasEncryption() bool { + if o != nil && !IsNil(o.Encryption) { + return true + } + + return false +} + +// SetEncryption gets a reference to the given InstanceEncryption and assigns it to the Encryption field. +func (o *CreateInstanceRequestPayload) SetEncryption(v InstanceEncryption) { + o.Encryption = &v +} + +// GetFlavorId returns the FlavorId field value +func (o *CreateInstanceRequestPayload) GetFlavorId() string { + if o == nil { + var ret string + return ret + } + + return o.FlavorId +} + +// GetFlavorIdOk returns a tuple with the FlavorId field value +// and a boolean to check if the value has been set. +func (o *CreateInstanceRequestPayload) GetFlavorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FlavorId, true +} + +// SetFlavorId sets field value +func (o *CreateInstanceRequestPayload) SetFlavorId(v string) { + o.FlavorId = v +} + +// GetName returns the Name field value +func (o *CreateInstanceRequestPayload) 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 *CreateInstanceRequestPayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateInstanceRequestPayload) SetName(v string) { + o.Name = v +} + +// GetNetwork returns the Network field value +func (o *CreateInstanceRequestPayload) GetNetwork() InstanceNetworkCreate { + if o == nil { + var ret InstanceNetworkCreate + return ret + } + + return o.Network +} + +// GetNetworkOk returns a tuple with the Network field value +// and a boolean to check if the value has been set. +func (o *CreateInstanceRequestPayload) GetNetworkOk() (*InstanceNetworkCreate, bool) { + if o == nil { + return nil, false + } + return &o.Network, true +} + +// SetNetwork sets field value +func (o *CreateInstanceRequestPayload) SetNetwork(v InstanceNetworkCreate) { + o.Network = v +} + +// GetReplicas returns the Replicas field value +func (o *CreateInstanceRequestPayload) GetReplicas() Replicas { + if o == nil { + var ret Replicas + return ret + } + + return o.Replicas +} + +// GetReplicasOk returns a tuple with the Replicas field value +// and a boolean to check if the value has been set. +func (o *CreateInstanceRequestPayload) GetReplicasOk() (*Replicas, bool) { + if o == nil { + return nil, false + } + return &o.Replicas, true +} + +// SetReplicas sets field value +func (o *CreateInstanceRequestPayload) SetReplicas(v Replicas) { + o.Replicas = v +} + +// GetRetentionDays returns the RetentionDays field value +func (o *CreateInstanceRequestPayload) GetRetentionDays() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.RetentionDays +} + +// GetRetentionDaysOk returns a tuple with the RetentionDays field value +// and a boolean to check if the value has been set. +func (o *CreateInstanceRequestPayload) GetRetentionDaysOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.RetentionDays, true +} + +// SetRetentionDays sets field value +func (o *CreateInstanceRequestPayload) SetRetentionDays(v int32) { + o.RetentionDays = v +} + +// GetStorage returns the Storage field value +func (o *CreateInstanceRequestPayload) GetStorage() StorageCreate { + if o == nil { + var ret StorageCreate + return ret + } + + return o.Storage +} + +// GetStorageOk returns a tuple with the Storage field value +// and a boolean to check if the value has been set. +func (o *CreateInstanceRequestPayload) GetStorageOk() (*StorageCreate, bool) { + if o == nil { + return nil, false + } + return &o.Storage, true +} + +// SetStorage sets field value +func (o *CreateInstanceRequestPayload) SetStorage(v StorageCreate) { + o.Storage = v +} + +// GetVersion returns the Version field value +func (o *CreateInstanceRequestPayload) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *CreateInstanceRequestPayload) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *CreateInstanceRequestPayload) SetVersion(v string) { + o.Version = v +} + +func (o CreateInstanceRequestPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateInstanceRequestPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["backupSchedule"] = o.BackupSchedule + if !IsNil(o.Encryption) { + toSerialize["encryption"] = o.Encryption + } + toSerialize["flavorId"] = o.FlavorId + toSerialize["name"] = o.Name + toSerialize["network"] = o.Network + toSerialize["replicas"] = o.Replicas + toSerialize["retentionDays"] = o.RetentionDays + toSerialize["storage"] = o.Storage + toSerialize["version"] = o.Version + return toSerialize, nil +} + +func (o *CreateInstanceRequestPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "backupSchedule", + "flavorId", + "name", + "network", + "replicas", + "retentionDays", + "storage", + "version", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateInstanceRequestPayload := _CreateInstanceRequestPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateInstanceRequestPayload) + + if err != nil { + return err + } + + *o = CreateInstanceRequestPayload(varCreateInstanceRequestPayload) + + return err +} + +type NullableCreateInstanceRequestPayload struct { + value *CreateInstanceRequestPayload + isSet bool +} + +func (v NullableCreateInstanceRequestPayload) Get() *CreateInstanceRequestPayload { + return v.value +} + +func (v *NullableCreateInstanceRequestPayload) Set(val *CreateInstanceRequestPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateInstanceRequestPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateInstanceRequestPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateInstanceRequestPayload(val *CreateInstanceRequestPayload) *NullableCreateInstanceRequestPayload { + return &NullableCreateInstanceRequestPayload{value: val, isSet: true} +} + +func (v NullableCreateInstanceRequestPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateInstanceRequestPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_create_instance_response.go b/services/postgresflex/v3alpha1api/model_create_instance_response.go new file mode 100644 index 000000000..003e325b2 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_create_instance_response.go @@ -0,0 +1,158 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateInstanceResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateInstanceResponse{} + +// CreateInstanceResponse struct for CreateInstanceResponse +type CreateInstanceResponse struct { + // The ID of the instance. + Id string `json:"id"` +} + +type _CreateInstanceResponse CreateInstanceResponse + +// NewCreateInstanceResponse instantiates a new CreateInstanceResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateInstanceResponse(id string) *CreateInstanceResponse { + this := CreateInstanceResponse{} + this.Id = id + return &this +} + +// NewCreateInstanceResponseWithDefaults instantiates a new CreateInstanceResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateInstanceResponseWithDefaults() *CreateInstanceResponse { + this := CreateInstanceResponse{} + return &this +} + +// GetId returns the Id field value +func (o *CreateInstanceResponse) 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 *CreateInstanceResponse) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CreateInstanceResponse) SetId(v string) { + o.Id = v +} + +func (o CreateInstanceResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateInstanceResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + return toSerialize, nil +} + +func (o *CreateInstanceResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateInstanceResponse := _CreateInstanceResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateInstanceResponse) + + if err != nil { + return err + } + + *o = CreateInstanceResponse(varCreateInstanceResponse) + + return err +} + +type NullableCreateInstanceResponse struct { + value *CreateInstanceResponse + isSet bool +} + +func (v NullableCreateInstanceResponse) Get() *CreateInstanceResponse { + return v.value +} + +func (v *NullableCreateInstanceResponse) Set(val *CreateInstanceResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCreateInstanceResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateInstanceResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateInstanceResponse(val *CreateInstanceResponse) *NullableCreateInstanceResponse { + return &NullableCreateInstanceResponse{value: val, isSet: true} +} + +func (v NullableCreateInstanceResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateInstanceResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_create_user_request_payload.go b/services/postgresflex/v3alpha1api/model_create_user_request_payload.go new file mode 100644 index 000000000..7942168ff --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_create_user_request_payload.go @@ -0,0 +1,195 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateUserRequestPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateUserRequestPayload{} + +// CreateUserRequestPayload struct for CreateUserRequestPayload +type CreateUserRequestPayload struct { + // The name of the user. + Name string `json:"name"` + // A list containing the user roles for the instance. + Roles []UserRole `json:"roles,omitempty"` +} + +type _CreateUserRequestPayload CreateUserRequestPayload + +// NewCreateUserRequestPayload instantiates a new CreateUserRequestPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateUserRequestPayload(name string) *CreateUserRequestPayload { + this := CreateUserRequestPayload{} + this.Name = name + return &this +} + +// NewCreateUserRequestPayloadWithDefaults instantiates a new CreateUserRequestPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateUserRequestPayloadWithDefaults() *CreateUserRequestPayload { + this := CreateUserRequestPayload{} + return &this +} + +// GetName returns the Name field value +func (o *CreateUserRequestPayload) 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 *CreateUserRequestPayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateUserRequestPayload) SetName(v string) { + o.Name = v +} + +// GetRoles returns the Roles field value if set, zero value otherwise. +func (o *CreateUserRequestPayload) GetRoles() []UserRole { + if o == nil || IsNil(o.Roles) { + var ret []UserRole + return ret + } + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateUserRequestPayload) GetRolesOk() ([]UserRole, bool) { + if o == nil || IsNil(o.Roles) { + return nil, false + } + return o.Roles, true +} + +// HasRoles returns a boolean if a field has been set. +func (o *CreateUserRequestPayload) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { + return true + } + + return false +} + +// SetRoles gets a reference to the given []UserRole and assigns it to the Roles field. +func (o *CreateUserRequestPayload) SetRoles(v []UserRole) { + o.Roles = v +} + +func (o CreateUserRequestPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateUserRequestPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Roles) { + toSerialize["roles"] = o.Roles + } + return toSerialize, nil +} + +func (o *CreateUserRequestPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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) + } + } + + varCreateUserRequestPayload := _CreateUserRequestPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateUserRequestPayload) + + if err != nil { + return err + } + + *o = CreateUserRequestPayload(varCreateUserRequestPayload) + + return err +} + +type NullableCreateUserRequestPayload struct { + value *CreateUserRequestPayload + isSet bool +} + +func (v NullableCreateUserRequestPayload) Get() *CreateUserRequestPayload { + return v.value +} + +func (v *NullableCreateUserRequestPayload) Set(val *CreateUserRequestPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateUserRequestPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateUserRequestPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateUserRequestPayload(val *CreateUserRequestPayload) *NullableCreateUserRequestPayload { + return &NullableCreateUserRequestPayload{value: val, isSet: true} +} + +func (v NullableCreateUserRequestPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateUserRequestPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_create_user_response.go b/services/postgresflex/v3alpha1api/model_create_user_response.go new file mode 100644 index 000000000..cb98d08fe --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_create_user_response.go @@ -0,0 +1,245 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateUserResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateUserResponse{} + +// CreateUserResponse struct for CreateUserResponse +type CreateUserResponse struct { + // The ID of the user. + Id int32 `json:"id"` + // The name of the user. + Name string `json:"name"` + // The password for the user. + Password string `json:"password"` + // The current status of the user. + Status string `json:"status"` +} + +type _CreateUserResponse CreateUserResponse + +// NewCreateUserResponse instantiates a new CreateUserResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateUserResponse(id int32, name string, password string, status string) *CreateUserResponse { + this := CreateUserResponse{} + this.Id = id + this.Name = name + this.Password = password + this.Status = status + return &this +} + +// NewCreateUserResponseWithDefaults instantiates a new CreateUserResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateUserResponseWithDefaults() *CreateUserResponse { + this := CreateUserResponse{} + return &this +} + +// GetId returns the Id field value +func (o *CreateUserResponse) GetId() int32 { + if o == nil { + var ret int32 + 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 *CreateUserResponse) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CreateUserResponse) SetId(v int32) { + o.Id = v +} + +// GetName returns the Name field value +func (o *CreateUserResponse) 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 *CreateUserResponse) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateUserResponse) SetName(v string) { + o.Name = v +} + +// GetPassword returns the Password field value +func (o *CreateUserResponse) GetPassword() string { + if o == nil { + var ret string + return ret + } + + return o.Password +} + +// GetPasswordOk returns a tuple with the Password field value +// and a boolean to check if the value has been set. +func (o *CreateUserResponse) GetPasswordOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Password, true +} + +// SetPassword sets field value +func (o *CreateUserResponse) SetPassword(v string) { + o.Password = v +} + +// GetStatus returns the Status field value +func (o *CreateUserResponse) 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 *CreateUserResponse) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *CreateUserResponse) SetStatus(v string) { + o.Status = v +} + +func (o CreateUserResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateUserResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["password"] = o.Password + toSerialize["status"] = o.Status + return toSerialize, nil +} + +func (o *CreateUserResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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", + "password", + "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) + } + } + + varCreateUserResponse := _CreateUserResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateUserResponse) + + if err != nil { + return err + } + + *o = CreateUserResponse(varCreateUserResponse) + + return err +} + +type NullableCreateUserResponse struct { + value *CreateUserResponse + isSet bool +} + +func (v NullableCreateUserResponse) Get() *CreateUserResponse { + return v.value +} + +func (v *NullableCreateUserResponse) Set(val *CreateUserResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCreateUserResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateUserResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateUserResponse(val *CreateUserResponse) *NullableCreateUserResponse { + return &NullableCreateUserResponse{value: val, isSet: true} +} + +func (v NullableCreateUserResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateUserResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_database_roles.go b/services/postgresflex/v3alpha1api/model_database_roles.go new file mode 100644 index 000000000..426759b81 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_database_roles.go @@ -0,0 +1,187 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the DatabaseRoles type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DatabaseRoles{} + +// DatabaseRoles The name and the roles for a database for a user. +type DatabaseRoles struct { + // The name of the database. + Name string `json:"name"` + // The name and the roles for a database + Roles []string `json:"roles"` +} + +type _DatabaseRoles DatabaseRoles + +// NewDatabaseRoles instantiates a new DatabaseRoles object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDatabaseRoles(name string, roles []string) *DatabaseRoles { + this := DatabaseRoles{} + this.Name = name + this.Roles = roles + return &this +} + +// NewDatabaseRolesWithDefaults instantiates a new DatabaseRoles object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDatabaseRolesWithDefaults() *DatabaseRoles { + this := DatabaseRoles{} + return &this +} + +// GetName returns the Name field value +func (o *DatabaseRoles) 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 *DatabaseRoles) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *DatabaseRoles) SetName(v string) { + o.Name = v +} + +// GetRoles returns the Roles field value +func (o *DatabaseRoles) GetRoles() []string { + if o == nil { + var ret []string + return ret + } + + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value +// and a boolean to check if the value has been set. +func (o *DatabaseRoles) GetRolesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Roles, true +} + +// SetRoles sets field value +func (o *DatabaseRoles) SetRoles(v []string) { + o.Roles = v +} + +func (o DatabaseRoles) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DatabaseRoles) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["roles"] = o.Roles + return toSerialize, nil +} + +func (o *DatabaseRoles) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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", + "roles", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDatabaseRoles := _DatabaseRoles{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDatabaseRoles) + + if err != nil { + return err + } + + *o = DatabaseRoles(varDatabaseRoles) + + return err +} + +type NullableDatabaseRoles struct { + value *DatabaseRoles + isSet bool +} + +func (v NullableDatabaseRoles) Get() *DatabaseRoles { + return v.value +} + +func (v *NullableDatabaseRoles) Set(val *DatabaseRoles) { + v.value = val + v.isSet = true +} + +func (v NullableDatabaseRoles) IsSet() bool { + return v.isSet +} + +func (v *NullableDatabaseRoles) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDatabaseRoles(val *DatabaseRoles) *NullableDatabaseRoles { + return &NullableDatabaseRoles{value: val, isSet: true} +} + +func (v NullableDatabaseRoles) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDatabaseRoles) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_database_sort.go b/services/postgresflex/v3alpha1api/model_database_sort.go new file mode 100644 index 000000000..8fa479a7e --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_database_sort.go @@ -0,0 +1,123 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "encoding/json" + "fmt" +) + +// DatabaseSort the model 'DatabaseSort' +type DatabaseSort string + +// List of database.sort +const ( + DATABASESORT_CREATED_AT_DESC DatabaseSort = "created_at.desc" + DATABASESORT_CREATED_AT_ASC DatabaseSort = "created_at.asc" + DATABASESORT_DATABASE_ID_DESC DatabaseSort = "database_id.desc" + DATABASESORT_DATABASE_ID_ASC DatabaseSort = "database_id.asc" + DATABASESORT_DATABASE_NAME_DESC DatabaseSort = "database_name.desc" + DATABASESORT_DATABASE_NAME_ASC DatabaseSort = "database_name.asc" + DATABASESORT_DATABASE_OWNER_DESC DatabaseSort = "database_owner.desc" + DATABASESORT_DATABASE_OWNER_ASC DatabaseSort = "database_owner.asc" +) + +// All allowed values of DatabaseSort enum +var AllowedDatabaseSortEnumValues = []DatabaseSort{ + "created_at.desc", + "created_at.asc", + "database_id.desc", + "database_id.asc", + "database_name.desc", + "database_name.asc", + "database_owner.desc", + "database_owner.asc", +} + +func (v *DatabaseSort) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DatabaseSort(value) + for _, existing := range AllowedDatabaseSortEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DatabaseSort", value) +} + +// NewDatabaseSortFromValue returns a pointer to a valid DatabaseSort +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDatabaseSortFromValue(v string) (*DatabaseSort, error) { + ev := DatabaseSort(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DatabaseSort: valid values are %v", v, AllowedDatabaseSortEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DatabaseSort) IsValid() bool { + for _, existing := range AllowedDatabaseSortEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to database.sort value +func (v DatabaseSort) Ptr() *DatabaseSort { + return &v +} + +type NullableDatabaseSort struct { + value *DatabaseSort + isSet bool +} + +func (v NullableDatabaseSort) Get() *DatabaseSort { + return v.value +} + +func (v *NullableDatabaseSort) Set(val *DatabaseSort) { + v.value = val + v.isSet = true +} + +func (v NullableDatabaseSort) IsSet() bool { + return v.isSet +} + +func (v *NullableDatabaseSort) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDatabaseSort(val *DatabaseSort) *NullableDatabaseSort { + return &NullableDatabaseSort{value: val, isSet: true} +} + +func (v NullableDatabaseSort) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDatabaseSort) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_error.go b/services/postgresflex/v3alpha1api/model_error.go new file mode 100644 index 000000000..7f1d7c54f --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_error.go @@ -0,0 +1,245 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the Error type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Error{} + +// Error struct for Error +type Error struct { + // The http error code of the error. + Code int32 `json:"code"` + // More detailed information about the error. + Message string `json:"message"` + // The trace id of the request. + TraceId string `json:"traceId"` + // Describes in which state the api was when the error happened. + Type string `json:"type"` +} + +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 int32, message string, traceId string, types string) *Error { + this := Error{} + this.Code = code + this.Message = message + this.TraceId = traceId + this.Type = types + 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() int32 { + if o == nil { + var ret int32 + 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() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Code, true +} + +// SetCode sets field value +func (o *Error) SetCode(v int32) { + o.Code = v +} + +// GetMessage returns the Message field value +func (o *Error) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *Error) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *Error) SetMessage(v string) { + o.Message = v +} + +// GetTraceId returns the TraceId field value +func (o *Error) GetTraceId() string { + if o == nil { + var ret string + return ret + } + + return o.TraceId +} + +// GetTraceIdOk returns a tuple with the TraceId field value +// and a boolean to check if the value has been set. +func (o *Error) GetTraceIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TraceId, true +} + +// SetTraceId sets field value +func (o *Error) SetTraceId(v string) { + o.TraceId = v +} + +// GetType returns the Type field value +func (o *Error) 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 *Error) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Error) SetType(v string) { + o.Type = 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["message"] = o.Message + toSerialize["traceId"] = o.TraceId + toSerialize["type"] = o.Type + 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", + "message", + "traceId", + "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) + } + } + + 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/postgresflex/v3alpha1api/model_flavor_sort.go b/services/postgresflex/v3alpha1api/model_flavor_sort.go new file mode 100644 index 000000000..74869da5a --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_flavor_sort.go @@ -0,0 +1,139 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "encoding/json" + "fmt" +) + +// FlavorSort the model 'FlavorSort' +type FlavorSort string + +// List of flavor.sort +const ( + FLAVORSORT_CPU_DESC FlavorSort = "cpu.desc" + FLAVORSORT_CPU_ASC FlavorSort = "cpu.asc" + FLAVORSORT_FLAVOR_DESCRIPTION_ASC FlavorSort = "flavor_description.asc" + FLAVORSORT_FLAVOR_DESCRIPTION_DESC FlavorSort = "flavor_description.desc" + FLAVORSORT_ID_DESC FlavorSort = "id.desc" + FLAVORSORT_ID_ASC FlavorSort = "id.asc" + FLAVORSORT_SIZE_MAX_DESC FlavorSort = "size_max.desc" + FLAVORSORT_SIZE_MAX_ASC FlavorSort = "size_max.asc" + FLAVORSORT_RAM_DESC FlavorSort = "ram.desc" + FLAVORSORT_RAM_ASC FlavorSort = "ram.asc" + FLAVORSORT_SIZE_MIN_DESC FlavorSort = "size_min.desc" + FLAVORSORT_SIZE_MIN_ASC FlavorSort = "size_min.asc" + FLAVORSORT_STORAGE_CLASS_ASC FlavorSort = "storage_class.asc" + FLAVORSORT_STORAGE_CLASS_DESC FlavorSort = "storage_class.desc" + FLAVORSORT_NODE_TYPE_ASC FlavorSort = "node_type.asc" + FLAVORSORT_NODE_TYPE_DESC FlavorSort = "node_type.desc" +) + +// All allowed values of FlavorSort enum +var AllowedFlavorSortEnumValues = []FlavorSort{ + "cpu.desc", + "cpu.asc", + "flavor_description.asc", + "flavor_description.desc", + "id.desc", + "id.asc", + "size_max.desc", + "size_max.asc", + "ram.desc", + "ram.asc", + "size_min.desc", + "size_min.asc", + "storage_class.asc", + "storage_class.desc", + "node_type.asc", + "node_type.desc", +} + +func (v *FlavorSort) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := FlavorSort(value) + for _, existing := range AllowedFlavorSortEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid FlavorSort", value) +} + +// NewFlavorSortFromValue returns a pointer to a valid FlavorSort +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewFlavorSortFromValue(v string) (*FlavorSort, error) { + ev := FlavorSort(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for FlavorSort: valid values are %v", v, AllowedFlavorSortEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v FlavorSort) IsValid() bool { + for _, existing := range AllowedFlavorSortEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to flavor.sort value +func (v FlavorSort) Ptr() *FlavorSort { + return &v +} + +type NullableFlavorSort struct { + value *FlavorSort + isSet bool +} + +func (v NullableFlavorSort) Get() *FlavorSort { + return v.value +} + +func (v *NullableFlavorSort) Set(val *FlavorSort) { + v.value = val + v.isSet = true +} + +func (v NullableFlavorSort) IsSet() bool { + return v.isSet +} + +func (v *NullableFlavorSort) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFlavorSort(val *FlavorSort) *NullableFlavorSort { + return &NullableFlavorSort{value: val, isSet: true} +} + +func (v NullableFlavorSort) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFlavorSort) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_flavor_storage_classes_storage_class.go b/services/postgresflex/v3alpha1api/model_flavor_storage_classes_storage_class.go new file mode 100644 index 000000000..8c6076122 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_flavor_storage_classes_storage_class.go @@ -0,0 +1,213 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the FlavorStorageClassesStorageClass type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FlavorStorageClassesStorageClass{} + +// FlavorStorageClassesStorageClass a storageClass defines how efficient the storage can work +type FlavorStorageClassesStorageClass struct { + Class string `json:"class"` + MaxIoPerSec int32 `json:"maxIoPerSec"` + MaxThroughInMb int32 `json:"maxThroughInMb"` +} + +type _FlavorStorageClassesStorageClass FlavorStorageClassesStorageClass + +// NewFlavorStorageClassesStorageClass instantiates a new FlavorStorageClassesStorageClass object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFlavorStorageClassesStorageClass(class string, maxIoPerSec int32, maxThroughInMb int32) *FlavorStorageClassesStorageClass { + this := FlavorStorageClassesStorageClass{} + this.Class = class + this.MaxIoPerSec = maxIoPerSec + this.MaxThroughInMb = maxThroughInMb + return &this +} + +// NewFlavorStorageClassesStorageClassWithDefaults instantiates a new FlavorStorageClassesStorageClass object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFlavorStorageClassesStorageClassWithDefaults() *FlavorStorageClassesStorageClass { + this := FlavorStorageClassesStorageClass{} + return &this +} + +// GetClass returns the Class field value +func (o *FlavorStorageClassesStorageClass) GetClass() string { + if o == nil { + var ret string + return ret + } + + return o.Class +} + +// GetClassOk returns a tuple with the Class field value +// and a boolean to check if the value has been set. +func (o *FlavorStorageClassesStorageClass) GetClassOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Class, true +} + +// SetClass sets field value +func (o *FlavorStorageClassesStorageClass) SetClass(v string) { + o.Class = v +} + +// GetMaxIoPerSec returns the MaxIoPerSec field value +func (o *FlavorStorageClassesStorageClass) GetMaxIoPerSec() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.MaxIoPerSec +} + +// GetMaxIoPerSecOk returns a tuple with the MaxIoPerSec field value +// and a boolean to check if the value has been set. +func (o *FlavorStorageClassesStorageClass) GetMaxIoPerSecOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.MaxIoPerSec, true +} + +// SetMaxIoPerSec sets field value +func (o *FlavorStorageClassesStorageClass) SetMaxIoPerSec(v int32) { + o.MaxIoPerSec = v +} + +// GetMaxThroughInMb returns the MaxThroughInMb field value +func (o *FlavorStorageClassesStorageClass) GetMaxThroughInMb() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.MaxThroughInMb +} + +// GetMaxThroughInMbOk returns a tuple with the MaxThroughInMb field value +// and a boolean to check if the value has been set. +func (o *FlavorStorageClassesStorageClass) GetMaxThroughInMbOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.MaxThroughInMb, true +} + +// SetMaxThroughInMb sets field value +func (o *FlavorStorageClassesStorageClass) SetMaxThroughInMb(v int32) { + o.MaxThroughInMb = v +} + +func (o FlavorStorageClassesStorageClass) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FlavorStorageClassesStorageClass) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["class"] = o.Class + toSerialize["maxIoPerSec"] = o.MaxIoPerSec + toSerialize["maxThroughInMb"] = o.MaxThroughInMb + return toSerialize, nil +} + +func (o *FlavorStorageClassesStorageClass) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "class", + "maxIoPerSec", + "maxThroughInMb", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFlavorStorageClassesStorageClass := _FlavorStorageClassesStorageClass{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varFlavorStorageClassesStorageClass) + + if err != nil { + return err + } + + *o = FlavorStorageClassesStorageClass(varFlavorStorageClassesStorageClass) + + return err +} + +type NullableFlavorStorageClassesStorageClass struct { + value *FlavorStorageClassesStorageClass + isSet bool +} + +func (v NullableFlavorStorageClassesStorageClass) Get() *FlavorStorageClassesStorageClass { + return v.value +} + +func (v *NullableFlavorStorageClassesStorageClass) Set(val *FlavorStorageClassesStorageClass) { + v.value = val + v.isSet = true +} + +func (v NullableFlavorStorageClassesStorageClass) IsSet() bool { + return v.isSet +} + +func (v *NullableFlavorStorageClassesStorageClass) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFlavorStorageClassesStorageClass(val *FlavorStorageClassesStorageClass) *NullableFlavorStorageClassesStorageClass { + return &NullableFlavorStorageClassesStorageClass{value: val, isSet: true} +} + +func (v NullableFlavorStorageClassesStorageClass) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFlavorStorageClassesStorageClass) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_get_backup_response.go b/services/postgresflex/v3alpha1api/model_get_backup_response.go new file mode 100644 index 000000000..a0c0f3f09 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_get_backup_response.go @@ -0,0 +1,303 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GetBackupResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBackupResponse{} + +// GetBackupResponse struct for GetBackupResponse +type GetBackupResponse struct { + // The time when the backup was completed in RFC3339 format. + CompletionTime string `json:"completionTime"` + // The ID of the backup. + Id int32 `json:"id"` + // The name of the backup. + Name string `json:"name"` + // The time until the backup will be retained. + RetainedUntil string `json:"retainedUntil"` + // The size of the backup in bytes. + Size int32 `json:"size"` + // The type of the backup, which can be automated or manual triggered. + Type string `json:"type"` +} + +type _GetBackupResponse GetBackupResponse + +// NewGetBackupResponse instantiates a new GetBackupResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetBackupResponse(completionTime string, id int32, name string, retainedUntil string, size int32, types string) *GetBackupResponse { + this := GetBackupResponse{} + this.CompletionTime = completionTime + this.Id = id + this.Name = name + this.RetainedUntil = retainedUntil + this.Size = size + this.Type = types + return &this +} + +// NewGetBackupResponseWithDefaults instantiates a new GetBackupResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetBackupResponseWithDefaults() *GetBackupResponse { + this := GetBackupResponse{} + return &this +} + +// GetCompletionTime returns the CompletionTime field value +func (o *GetBackupResponse) GetCompletionTime() string { + if o == nil { + var ret string + return ret + } + + return o.CompletionTime +} + +// GetCompletionTimeOk returns a tuple with the CompletionTime field value +// and a boolean to check if the value has been set. +func (o *GetBackupResponse) GetCompletionTimeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CompletionTime, true +} + +// SetCompletionTime sets field value +func (o *GetBackupResponse) SetCompletionTime(v string) { + o.CompletionTime = v +} + +// GetId returns the Id field value +func (o *GetBackupResponse) GetId() int32 { + if o == nil { + var ret int32 + 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 *GetBackupResponse) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *GetBackupResponse) SetId(v int32) { + o.Id = v +} + +// GetName returns the Name field value +func (o *GetBackupResponse) 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 *GetBackupResponse) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *GetBackupResponse) SetName(v string) { + o.Name = v +} + +// GetRetainedUntil returns the RetainedUntil field value +func (o *GetBackupResponse) GetRetainedUntil() string { + if o == nil { + var ret string + return ret + } + + return o.RetainedUntil +} + +// GetRetainedUntilOk returns a tuple with the RetainedUntil field value +// and a boolean to check if the value has been set. +func (o *GetBackupResponse) GetRetainedUntilOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RetainedUntil, true +} + +// SetRetainedUntil sets field value +func (o *GetBackupResponse) SetRetainedUntil(v string) { + o.RetainedUntil = v +} + +// GetSize returns the Size field value +func (o *GetBackupResponse) GetSize() int32 { + if o == nil { + var ret int32 + 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 *GetBackupResponse) GetSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value +func (o *GetBackupResponse) SetSize(v int32) { + o.Size = v +} + +// GetType returns the Type field value +func (o *GetBackupResponse) 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 *GetBackupResponse) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *GetBackupResponse) SetType(v string) { + o.Type = v +} + +func (o GetBackupResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBackupResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["completionTime"] = o.CompletionTime + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["retainedUntil"] = o.RetainedUntil + toSerialize["size"] = o.Size + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *GetBackupResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "completionTime", + "id", + "name", + "retainedUntil", + "size", + "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) + } + } + + varGetBackupResponse := _GetBackupResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetBackupResponse) + + if err != nil { + return err + } + + *o = GetBackupResponse(varGetBackupResponse) + + return err +} + +type NullableGetBackupResponse struct { + value *GetBackupResponse + isSet bool +} + +func (v NullableGetBackupResponse) Get() *GetBackupResponse { + return v.value +} + +func (v *NullableGetBackupResponse) Set(val *GetBackupResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetBackupResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBackupResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBackupResponse(val *GetBackupResponse) *NullableGetBackupResponse { + return &NullableGetBackupResponse{value: val, isSet: true} +} + +func (v NullableGetBackupResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBackupResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_get_collations_response.go b/services/postgresflex/v3alpha1api/model_get_collations_response.go new file mode 100644 index 000000000..6ac25bf29 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_get_collations_response.go @@ -0,0 +1,158 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GetCollationsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetCollationsResponse{} + +// GetCollationsResponse struct for GetCollationsResponse +type GetCollationsResponse struct { + // List of collations available for the instance. + Collations []string `json:"collations"` +} + +type _GetCollationsResponse GetCollationsResponse + +// NewGetCollationsResponse instantiates a new GetCollationsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetCollationsResponse(collations []string) *GetCollationsResponse { + this := GetCollationsResponse{} + this.Collations = collations + return &this +} + +// NewGetCollationsResponseWithDefaults instantiates a new GetCollationsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetCollationsResponseWithDefaults() *GetCollationsResponse { + this := GetCollationsResponse{} + return &this +} + +// GetCollations returns the Collations field value +func (o *GetCollationsResponse) GetCollations() []string { + if o == nil { + var ret []string + return ret + } + + return o.Collations +} + +// GetCollationsOk returns a tuple with the Collations field value +// and a boolean to check if the value has been set. +func (o *GetCollationsResponse) GetCollationsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Collations, true +} + +// SetCollations sets field value +func (o *GetCollationsResponse) SetCollations(v []string) { + o.Collations = v +} + +func (o GetCollationsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetCollationsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["collations"] = o.Collations + return toSerialize, nil +} + +func (o *GetCollationsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "collations", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetCollationsResponse := _GetCollationsResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetCollationsResponse) + + if err != nil { + return err + } + + *o = GetCollationsResponse(varGetCollationsResponse) + + return err +} + +type NullableGetCollationsResponse struct { + value *GetCollationsResponse + isSet bool +} + +func (v NullableGetCollationsResponse) Get() *GetCollationsResponse { + return v.value +} + +func (v *NullableGetCollationsResponse) Set(val *GetCollationsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetCollationsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetCollationsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetCollationsResponse(val *GetCollationsResponse) *NullableGetCollationsResponse { + return &NullableGetCollationsResponse{value: val, isSet: true} +} + +func (v NullableGetCollationsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetCollationsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_get_database_response.go b/services/postgresflex/v3alpha1api/model_get_database_response.go new file mode 100644 index 000000000..119067b3d --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_get_database_response.go @@ -0,0 +1,216 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GetDatabaseResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetDatabaseResponse{} + +// GetDatabaseResponse struct for GetDatabaseResponse +type GetDatabaseResponse struct { + // The id of the database. + Id int32 `json:"id"` + // The name of the database. + Name string `json:"name"` + // The owner of the database. + Owner string `json:"owner"` +} + +type _GetDatabaseResponse GetDatabaseResponse + +// NewGetDatabaseResponse instantiates a new GetDatabaseResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetDatabaseResponse(id int32, name string, owner string) *GetDatabaseResponse { + this := GetDatabaseResponse{} + this.Id = id + this.Name = name + this.Owner = owner + return &this +} + +// NewGetDatabaseResponseWithDefaults instantiates a new GetDatabaseResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetDatabaseResponseWithDefaults() *GetDatabaseResponse { + this := GetDatabaseResponse{} + return &this +} + +// GetId returns the Id field value +func (o *GetDatabaseResponse) GetId() int32 { + if o == nil { + var ret int32 + 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 *GetDatabaseResponse) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *GetDatabaseResponse) SetId(v int32) { + o.Id = v +} + +// GetName returns the Name field value +func (o *GetDatabaseResponse) 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 *GetDatabaseResponse) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *GetDatabaseResponse) SetName(v string) { + o.Name = v +} + +// GetOwner returns the Owner field value +func (o *GetDatabaseResponse) GetOwner() string { + if o == nil { + var ret string + return ret + } + + return o.Owner +} + +// GetOwnerOk returns a tuple with the Owner field value +// and a boolean to check if the value has been set. +func (o *GetDatabaseResponse) GetOwnerOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Owner, true +} + +// SetOwner sets field value +func (o *GetDatabaseResponse) SetOwner(v string) { + o.Owner = v +} + +func (o GetDatabaseResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetDatabaseResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["owner"] = o.Owner + return toSerialize, nil +} + +func (o *GetDatabaseResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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", + "owner", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetDatabaseResponse := _GetDatabaseResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetDatabaseResponse) + + if err != nil { + return err + } + + *o = GetDatabaseResponse(varGetDatabaseResponse) + + return err +} + +type NullableGetDatabaseResponse struct { + value *GetDatabaseResponse + isSet bool +} + +func (v NullableGetDatabaseResponse) Get() *GetDatabaseResponse { + return v.value +} + +func (v *NullableGetDatabaseResponse) Set(val *GetDatabaseResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetDatabaseResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetDatabaseResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetDatabaseResponse(val *GetDatabaseResponse) *NullableGetDatabaseResponse { + return &NullableGetDatabaseResponse{value: val, isSet: true} +} + +func (v NullableGetDatabaseResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetDatabaseResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_get_flavors_response.go b/services/postgresflex/v3alpha1api/model_get_flavors_response.go new file mode 100644 index 000000000..2d45d9292 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_get_flavors_response.go @@ -0,0 +1,186 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GetFlavorsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetFlavorsResponse{} + +// GetFlavorsResponse struct for GetFlavorsResponse +type GetFlavorsResponse struct { + // List of flavors available for the project. + Flavors []ListFlavors `json:"flavors"` + Pagination Pagination `json:"pagination"` +} + +type _GetFlavorsResponse GetFlavorsResponse + +// NewGetFlavorsResponse instantiates a new GetFlavorsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetFlavorsResponse(flavors []ListFlavors, pagination Pagination) *GetFlavorsResponse { + this := GetFlavorsResponse{} + this.Flavors = flavors + this.Pagination = pagination + return &this +} + +// NewGetFlavorsResponseWithDefaults instantiates a new GetFlavorsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetFlavorsResponseWithDefaults() *GetFlavorsResponse { + this := GetFlavorsResponse{} + return &this +} + +// GetFlavors returns the Flavors field value +func (o *GetFlavorsResponse) GetFlavors() []ListFlavors { + if o == nil { + var ret []ListFlavors + return ret + } + + return o.Flavors +} + +// GetFlavorsOk returns a tuple with the Flavors field value +// and a boolean to check if the value has been set. +func (o *GetFlavorsResponse) GetFlavorsOk() ([]ListFlavors, bool) { + if o == nil { + return nil, false + } + return o.Flavors, true +} + +// SetFlavors sets field value +func (o *GetFlavorsResponse) SetFlavors(v []ListFlavors) { + o.Flavors = v +} + +// GetPagination returns the Pagination field value +func (o *GetFlavorsResponse) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *GetFlavorsResponse) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *GetFlavorsResponse) SetPagination(v Pagination) { + o.Pagination = v +} + +func (o GetFlavorsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetFlavorsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["flavors"] = o.Flavors + toSerialize["pagination"] = o.Pagination + return toSerialize, nil +} + +func (o *GetFlavorsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "flavors", + "pagination", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetFlavorsResponse := _GetFlavorsResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetFlavorsResponse) + + if err != nil { + return err + } + + *o = GetFlavorsResponse(varGetFlavorsResponse) + + return err +} + +type NullableGetFlavorsResponse struct { + value *GetFlavorsResponse + isSet bool +} + +func (v NullableGetFlavorsResponse) Get() *GetFlavorsResponse { + return v.value +} + +func (v *NullableGetFlavorsResponse) Set(val *GetFlavorsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetFlavorsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetFlavorsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetFlavorsResponse(val *GetFlavorsResponse) *NullableGetFlavorsResponse { + return &NullableGetFlavorsResponse{value: val, isSet: true} +} + +func (v NullableGetFlavorsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetFlavorsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_get_instance_response.go b/services/postgresflex/v3alpha1api/model_get_instance_response.go new file mode 100644 index 000000000..e254c9fc7 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_get_instance_response.go @@ -0,0 +1,545 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GetInstanceResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetInstanceResponse{} + +// GetInstanceResponse struct for GetInstanceResponse +type GetInstanceResponse struct { + // List of IPV4 cidr. + Acl []string `json:"acl,omitempty"` + // The schedule for when the database backup will be created. Currently, ONLY daily schedules are supported (every 24 hours). The schedule is written as a cron schedule. + BackupSchedule string `json:"backupSchedule"` + ConnectionInfo InstanceConnectionInfo `json:"connectionInfo"` + Encryption *InstanceEncryption `json:"encryption,omitempty"` + // The id of the instance flavor. + FlavorId string `json:"flavorId"` + // The ID of the instance. + Id string `json:"id"` + // Whether the instance can be deleted or not. + IsDeletable bool `json:"isDeletable"` + // The name of the instance. + Name string `json:"name"` + Network InstanceNetwork `json:"network"` + Replicas Replicas `json:"replicas"` + // How long backups are retained. The value can only be between 32 and 365 days. + RetentionDays int32 `json:"retentionDays"` + Status Status `json:"status"` + Storage Storage `json:"storage"` + // The Postgres version used for the instance. See [Versions Endpoint](/documentation/postgres-flex-service/version/v3alpha1#tag/Version) for supported version parameters. + Version string `json:"version"` +} + +type _GetInstanceResponse GetInstanceResponse + +// NewGetInstanceResponse instantiates a new GetInstanceResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetInstanceResponse(backupSchedule string, connectionInfo InstanceConnectionInfo, flavorId string, id string, isDeletable bool, name string, network InstanceNetwork, replicas Replicas, retentionDays int32, status Status, storage Storage, version string) *GetInstanceResponse { + this := GetInstanceResponse{} + this.BackupSchedule = backupSchedule + this.ConnectionInfo = connectionInfo + this.FlavorId = flavorId + this.Id = id + this.IsDeletable = isDeletable + this.Name = name + this.Network = network + this.Replicas = replicas + this.RetentionDays = retentionDays + this.Status = status + this.Storage = storage + this.Version = version + return &this +} + +// NewGetInstanceResponseWithDefaults instantiates a new GetInstanceResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetInstanceResponseWithDefaults() *GetInstanceResponse { + this := GetInstanceResponse{} + return &this +} + +// GetAcl returns the Acl field value if set, zero value otherwise. +func (o *GetInstanceResponse) GetAcl() []string { + if o == nil || IsNil(o.Acl) { + var ret []string + return ret + } + return o.Acl +} + +// GetAclOk returns a tuple with the Acl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetInstanceResponse) GetAclOk() ([]string, bool) { + if o == nil || IsNil(o.Acl) { + return nil, false + } + return o.Acl, true +} + +// HasAcl returns a boolean if a field has been set. +func (o *GetInstanceResponse) HasAcl() bool { + if o != nil && !IsNil(o.Acl) { + return true + } + + return false +} + +// SetAcl gets a reference to the given []string and assigns it to the Acl field. +func (o *GetInstanceResponse) SetAcl(v []string) { + o.Acl = v +} + +// GetBackupSchedule returns the BackupSchedule field value +func (o *GetInstanceResponse) GetBackupSchedule() string { + if o == nil { + var ret string + return ret + } + + return o.BackupSchedule +} + +// GetBackupScheduleOk returns a tuple with the BackupSchedule field value +// and a boolean to check if the value has been set. +func (o *GetInstanceResponse) GetBackupScheduleOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BackupSchedule, true +} + +// SetBackupSchedule sets field value +func (o *GetInstanceResponse) SetBackupSchedule(v string) { + o.BackupSchedule = v +} + +// GetConnectionInfo returns the ConnectionInfo field value +func (o *GetInstanceResponse) GetConnectionInfo() InstanceConnectionInfo { + if o == nil { + var ret InstanceConnectionInfo + return ret + } + + return o.ConnectionInfo +} + +// GetConnectionInfoOk returns a tuple with the ConnectionInfo field value +// and a boolean to check if the value has been set. +func (o *GetInstanceResponse) GetConnectionInfoOk() (*InstanceConnectionInfo, bool) { + if o == nil { + return nil, false + } + return &o.ConnectionInfo, true +} + +// SetConnectionInfo sets field value +func (o *GetInstanceResponse) SetConnectionInfo(v InstanceConnectionInfo) { + o.ConnectionInfo = v +} + +// GetEncryption returns the Encryption field value if set, zero value otherwise. +func (o *GetInstanceResponse) GetEncryption() InstanceEncryption { + if o == nil || IsNil(o.Encryption) { + var ret InstanceEncryption + return ret + } + return *o.Encryption +} + +// GetEncryptionOk returns a tuple with the Encryption field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetInstanceResponse) GetEncryptionOk() (*InstanceEncryption, bool) { + if o == nil || IsNil(o.Encryption) { + return nil, false + } + return o.Encryption, true +} + +// HasEncryption returns a boolean if a field has been set. +func (o *GetInstanceResponse) HasEncryption() bool { + if o != nil && !IsNil(o.Encryption) { + return true + } + + return false +} + +// SetEncryption gets a reference to the given InstanceEncryption and assigns it to the Encryption field. +func (o *GetInstanceResponse) SetEncryption(v InstanceEncryption) { + o.Encryption = &v +} + +// GetFlavorId returns the FlavorId field value +func (o *GetInstanceResponse) GetFlavorId() string { + if o == nil { + var ret string + return ret + } + + return o.FlavorId +} + +// GetFlavorIdOk returns a tuple with the FlavorId field value +// and a boolean to check if the value has been set. +func (o *GetInstanceResponse) GetFlavorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FlavorId, true +} + +// SetFlavorId sets field value +func (o *GetInstanceResponse) SetFlavorId(v string) { + o.FlavorId = v +} + +// GetId returns the Id field value +func (o *GetInstanceResponse) 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 *GetInstanceResponse) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *GetInstanceResponse) SetId(v string) { + o.Id = v +} + +// GetIsDeletable returns the IsDeletable field value +func (o *GetInstanceResponse) GetIsDeletable() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsDeletable +} + +// GetIsDeletableOk returns a tuple with the IsDeletable field value +// and a boolean to check if the value has been set. +func (o *GetInstanceResponse) GetIsDeletableOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsDeletable, true +} + +// SetIsDeletable sets field value +func (o *GetInstanceResponse) SetIsDeletable(v bool) { + o.IsDeletable = v +} + +// GetName returns the Name field value +func (o *GetInstanceResponse) 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 *GetInstanceResponse) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *GetInstanceResponse) SetName(v string) { + o.Name = v +} + +// GetNetwork returns the Network field value +func (o *GetInstanceResponse) GetNetwork() InstanceNetwork { + if o == nil { + var ret InstanceNetwork + return ret + } + + return o.Network +} + +// GetNetworkOk returns a tuple with the Network field value +// and a boolean to check if the value has been set. +func (o *GetInstanceResponse) GetNetworkOk() (*InstanceNetwork, bool) { + if o == nil { + return nil, false + } + return &o.Network, true +} + +// SetNetwork sets field value +func (o *GetInstanceResponse) SetNetwork(v InstanceNetwork) { + o.Network = v +} + +// GetReplicas returns the Replicas field value +func (o *GetInstanceResponse) GetReplicas() Replicas { + if o == nil { + var ret Replicas + return ret + } + + return o.Replicas +} + +// GetReplicasOk returns a tuple with the Replicas field value +// and a boolean to check if the value has been set. +func (o *GetInstanceResponse) GetReplicasOk() (*Replicas, bool) { + if o == nil { + return nil, false + } + return &o.Replicas, true +} + +// SetReplicas sets field value +func (o *GetInstanceResponse) SetReplicas(v Replicas) { + o.Replicas = v +} + +// GetRetentionDays returns the RetentionDays field value +func (o *GetInstanceResponse) GetRetentionDays() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.RetentionDays +} + +// GetRetentionDaysOk returns a tuple with the RetentionDays field value +// and a boolean to check if the value has been set. +func (o *GetInstanceResponse) GetRetentionDaysOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.RetentionDays, true +} + +// SetRetentionDays sets field value +func (o *GetInstanceResponse) SetRetentionDays(v int32) { + o.RetentionDays = v +} + +// GetStatus returns the Status field value +func (o *GetInstanceResponse) GetStatus() Status { + if o == nil { + var ret Status + 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 *GetInstanceResponse) GetStatusOk() (*Status, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *GetInstanceResponse) SetStatus(v Status) { + o.Status = v +} + +// GetStorage returns the Storage field value +func (o *GetInstanceResponse) GetStorage() Storage { + if o == nil { + var ret Storage + return ret + } + + return o.Storage +} + +// GetStorageOk returns a tuple with the Storage field value +// and a boolean to check if the value has been set. +func (o *GetInstanceResponse) GetStorageOk() (*Storage, bool) { + if o == nil { + return nil, false + } + return &o.Storage, true +} + +// SetStorage sets field value +func (o *GetInstanceResponse) SetStorage(v Storage) { + o.Storage = v +} + +// GetVersion returns the Version field value +func (o *GetInstanceResponse) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *GetInstanceResponse) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *GetInstanceResponse) SetVersion(v string) { + o.Version = v +} + +func (o GetInstanceResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetInstanceResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Acl) { + toSerialize["acl"] = o.Acl + } + toSerialize["backupSchedule"] = o.BackupSchedule + toSerialize["connectionInfo"] = o.ConnectionInfo + if !IsNil(o.Encryption) { + toSerialize["encryption"] = o.Encryption + } + toSerialize["flavorId"] = o.FlavorId + toSerialize["id"] = o.Id + toSerialize["isDeletable"] = o.IsDeletable + toSerialize["name"] = o.Name + toSerialize["network"] = o.Network + toSerialize["replicas"] = o.Replicas + toSerialize["retentionDays"] = o.RetentionDays + toSerialize["status"] = o.Status + toSerialize["storage"] = o.Storage + toSerialize["version"] = o.Version + return toSerialize, nil +} + +func (o *GetInstanceResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "backupSchedule", + "connectionInfo", + "flavorId", + "id", + "isDeletable", + "name", + "network", + "replicas", + "retentionDays", + "status", + "storage", + "version", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetInstanceResponse := _GetInstanceResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetInstanceResponse) + + if err != nil { + return err + } + + *o = GetInstanceResponse(varGetInstanceResponse) + + return err +} + +type NullableGetInstanceResponse struct { + value *GetInstanceResponse + isSet bool +} + +func (v NullableGetInstanceResponse) Get() *GetInstanceResponse { + return v.value +} + +func (v *NullableGetInstanceResponse) Set(val *GetInstanceResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetInstanceResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetInstanceResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetInstanceResponse(val *GetInstanceResponse) *NullableGetInstanceResponse { + return &NullableGetInstanceResponse{value: val, isSet: true} +} + +func (v NullableGetInstanceResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetInstanceResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_get_user_response.go b/services/postgresflex/v3alpha1api/model_get_user_response.go new file mode 100644 index 000000000..4490ec4b2 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_get_user_response.go @@ -0,0 +1,245 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GetUserResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetUserResponse{} + +// GetUserResponse struct for GetUserResponse +type GetUserResponse struct { + // The ID of the user. + Id int32 `json:"id"` + // The name of the user. + Name string `json:"name"` + // A list of user roles. + Roles []UserRole `json:"roles"` + // The current status of the user. + Status string `json:"status"` +} + +type _GetUserResponse GetUserResponse + +// NewGetUserResponse instantiates a new GetUserResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetUserResponse(id int32, name string, roles []UserRole, status string) *GetUserResponse { + this := GetUserResponse{} + this.Id = id + this.Name = name + this.Roles = roles + this.Status = status + return &this +} + +// NewGetUserResponseWithDefaults instantiates a new GetUserResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetUserResponseWithDefaults() *GetUserResponse { + this := GetUserResponse{} + return &this +} + +// GetId returns the Id field value +func (o *GetUserResponse) GetId() int32 { + if o == nil { + var ret int32 + 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 *GetUserResponse) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *GetUserResponse) SetId(v int32) { + o.Id = v +} + +// GetName returns the Name field value +func (o *GetUserResponse) 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 *GetUserResponse) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *GetUserResponse) SetName(v string) { + o.Name = v +} + +// GetRoles returns the Roles field value +func (o *GetUserResponse) GetRoles() []UserRole { + if o == nil { + var ret []UserRole + return ret + } + + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value +// and a boolean to check if the value has been set. +func (o *GetUserResponse) GetRolesOk() ([]UserRole, bool) { + if o == nil { + return nil, false + } + return o.Roles, true +} + +// SetRoles sets field value +func (o *GetUserResponse) SetRoles(v []UserRole) { + o.Roles = v +} + +// GetStatus returns the Status field value +func (o *GetUserResponse) 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 *GetUserResponse) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *GetUserResponse) SetStatus(v string) { + o.Status = v +} + +func (o GetUserResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetUserResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["roles"] = o.Roles + toSerialize["status"] = o.Status + return toSerialize, nil +} + +func (o *GetUserResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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", + "roles", + "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) + } + } + + varGetUserResponse := _GetUserResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetUserResponse) + + if err != nil { + return err + } + + *o = GetUserResponse(varGetUserResponse) + + return err +} + +type NullableGetUserResponse struct { + value *GetUserResponse + isSet bool +} + +func (v NullableGetUserResponse) Get() *GetUserResponse { + return v.value +} + +func (v *NullableGetUserResponse) Set(val *GetUserResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetUserResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetUserResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetUserResponse(val *GetUserResponse) *NullableGetUserResponse { + return &NullableGetUserResponse{value: val, isSet: true} +} + +func (v NullableGetUserResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetUserResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_get_versions_response.go b/services/postgresflex/v3alpha1api/model_get_versions_response.go new file mode 100644 index 000000000..311ee1c5b --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_get_versions_response.go @@ -0,0 +1,158 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GetVersionsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetVersionsResponse{} + +// GetVersionsResponse struct for GetVersionsResponse +type GetVersionsResponse struct { + // A list containing available postgres versions. + Versions []Version `json:"versions"` +} + +type _GetVersionsResponse GetVersionsResponse + +// NewGetVersionsResponse instantiates a new GetVersionsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetVersionsResponse(versions []Version) *GetVersionsResponse { + this := GetVersionsResponse{} + this.Versions = versions + return &this +} + +// NewGetVersionsResponseWithDefaults instantiates a new GetVersionsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetVersionsResponseWithDefaults() *GetVersionsResponse { + this := GetVersionsResponse{} + return &this +} + +// GetVersions returns the Versions field value +func (o *GetVersionsResponse) GetVersions() []Version { + if o == nil { + var ret []Version + return ret + } + + return o.Versions +} + +// GetVersionsOk returns a tuple with the Versions field value +// and a boolean to check if the value has been set. +func (o *GetVersionsResponse) GetVersionsOk() ([]Version, bool) { + if o == nil { + return nil, false + } + return o.Versions, true +} + +// SetVersions sets field value +func (o *GetVersionsResponse) SetVersions(v []Version) { + o.Versions = v +} + +func (o GetVersionsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetVersionsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["versions"] = o.Versions + return toSerialize, nil +} + +func (o *GetVersionsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "versions", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetVersionsResponse := _GetVersionsResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetVersionsResponse) + + if err != nil { + return err + } + + *o = GetVersionsResponse(varGetVersionsResponse) + + return err +} + +type NullableGetVersionsResponse struct { + value *GetVersionsResponse + isSet bool +} + +func (v NullableGetVersionsResponse) Get() *GetVersionsResponse { + return v.value +} + +func (v *NullableGetVersionsResponse) Set(val *GetVersionsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetVersionsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetVersionsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetVersionsResponse(val *GetVersionsResponse) *NullableGetVersionsResponse { + return &NullableGetVersionsResponse{value: val, isSet: true} +} + +func (v NullableGetVersionsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetVersionsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_instance_connection_info.go b/services/postgresflex/v3alpha1api/model_instance_connection_info.go new file mode 100644 index 000000000..e1d4cf9c8 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_instance_connection_info.go @@ -0,0 +1,157 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the InstanceConnectionInfo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceConnectionInfo{} + +// InstanceConnectionInfo The connection information of the instance +type InstanceConnectionInfo struct { + Write InstanceConnectionInfoWrite `json:"write"` +} + +type _InstanceConnectionInfo InstanceConnectionInfo + +// NewInstanceConnectionInfo instantiates a new InstanceConnectionInfo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceConnectionInfo(write InstanceConnectionInfoWrite) *InstanceConnectionInfo { + this := InstanceConnectionInfo{} + this.Write = write + return &this +} + +// NewInstanceConnectionInfoWithDefaults instantiates a new InstanceConnectionInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceConnectionInfoWithDefaults() *InstanceConnectionInfo { + this := InstanceConnectionInfo{} + return &this +} + +// GetWrite returns the Write field value +func (o *InstanceConnectionInfo) GetWrite() InstanceConnectionInfoWrite { + if o == nil { + var ret InstanceConnectionInfoWrite + return ret + } + + return o.Write +} + +// GetWriteOk returns a tuple with the Write field value +// and a boolean to check if the value has been set. +func (o *InstanceConnectionInfo) GetWriteOk() (*InstanceConnectionInfoWrite, bool) { + if o == nil { + return nil, false + } + return &o.Write, true +} + +// SetWrite sets field value +func (o *InstanceConnectionInfo) SetWrite(v InstanceConnectionInfoWrite) { + o.Write = v +} + +func (o InstanceConnectionInfo) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceConnectionInfo) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["write"] = o.Write + return toSerialize, nil +} + +func (o *InstanceConnectionInfo) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "write", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInstanceConnectionInfo := _InstanceConnectionInfo{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varInstanceConnectionInfo) + + if err != nil { + return err + } + + *o = InstanceConnectionInfo(varInstanceConnectionInfo) + + return err +} + +type NullableInstanceConnectionInfo struct { + value *InstanceConnectionInfo + isSet bool +} + +func (v NullableInstanceConnectionInfo) Get() *InstanceConnectionInfo { + return v.value +} + +func (v *NullableInstanceConnectionInfo) Set(val *InstanceConnectionInfo) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceConnectionInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceConnectionInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceConnectionInfo(val *InstanceConnectionInfo) *NullableInstanceConnectionInfo { + return &NullableInstanceConnectionInfo{value: val, isSet: true} +} + +func (v NullableInstanceConnectionInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceConnectionInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_instance_connection_info_write.go b/services/postgresflex/v3alpha1api/model_instance_connection_info_write.go new file mode 100644 index 000000000..a0d4dba5e --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_instance_connection_info_write.go @@ -0,0 +1,187 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the InstanceConnectionInfoWrite type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceConnectionInfoWrite{} + +// InstanceConnectionInfoWrite The DNS name and port in the instance overview +type InstanceConnectionInfoWrite struct { + // The host of the instance. + Host string `json:"host"` + // The port of the instance. + Port int32 `json:"port"` +} + +type _InstanceConnectionInfoWrite InstanceConnectionInfoWrite + +// NewInstanceConnectionInfoWrite instantiates a new InstanceConnectionInfoWrite object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceConnectionInfoWrite(host string, port int32) *InstanceConnectionInfoWrite { + this := InstanceConnectionInfoWrite{} + this.Host = host + this.Port = port + return &this +} + +// NewInstanceConnectionInfoWriteWithDefaults instantiates a new InstanceConnectionInfoWrite object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceConnectionInfoWriteWithDefaults() *InstanceConnectionInfoWrite { + this := InstanceConnectionInfoWrite{} + return &this +} + +// GetHost returns the Host field value +func (o *InstanceConnectionInfoWrite) GetHost() string { + if o == nil { + var ret string + return ret + } + + return o.Host +} + +// GetHostOk returns a tuple with the Host field value +// and a boolean to check if the value has been set. +func (o *InstanceConnectionInfoWrite) GetHostOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Host, true +} + +// SetHost sets field value +func (o *InstanceConnectionInfoWrite) SetHost(v string) { + o.Host = v +} + +// GetPort returns the Port field value +func (o *InstanceConnectionInfoWrite) GetPort() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Port +} + +// GetPortOk returns a tuple with the Port field value +// and a boolean to check if the value has been set. +func (o *InstanceConnectionInfoWrite) GetPortOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Port, true +} + +// SetPort sets field value +func (o *InstanceConnectionInfoWrite) SetPort(v int32) { + o.Port = v +} + +func (o InstanceConnectionInfoWrite) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceConnectionInfoWrite) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["host"] = o.Host + toSerialize["port"] = o.Port + return toSerialize, nil +} + +func (o *InstanceConnectionInfoWrite) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "host", + "port", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInstanceConnectionInfoWrite := _InstanceConnectionInfoWrite{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varInstanceConnectionInfoWrite) + + if err != nil { + return err + } + + *o = InstanceConnectionInfoWrite(varInstanceConnectionInfoWrite) + + return err +} + +type NullableInstanceConnectionInfoWrite struct { + value *InstanceConnectionInfoWrite + isSet bool +} + +func (v NullableInstanceConnectionInfoWrite) Get() *InstanceConnectionInfoWrite { + return v.value +} + +func (v *NullableInstanceConnectionInfoWrite) Set(val *InstanceConnectionInfoWrite) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceConnectionInfoWrite) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceConnectionInfoWrite) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceConnectionInfoWrite(val *InstanceConnectionInfoWrite) *NullableInstanceConnectionInfoWrite { + return &NullableInstanceConnectionInfoWrite{value: val, isSet: true} +} + +func (v NullableInstanceConnectionInfoWrite) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceConnectionInfoWrite) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_instance_encryption.go b/services/postgresflex/v3alpha1api/model_instance_encryption.go new file mode 100644 index 000000000..17d37d3e1 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_instance_encryption.go @@ -0,0 +1,244 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the InstanceEncryption type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceEncryption{} + +// InstanceEncryption The configuration for instance's volume and backup storage encryption. ⚠︝ **Note:** This feature is in private preview. Supplying this object is only permitted for enabled accounts. If your account does not have access, the request will be rejected. +type InstanceEncryption struct { + // The encryption-key key identifier + KekKeyId string `json:"kekKeyId"` + // The encryption-key keyring identifier + KekKeyRingId string `json:"kekKeyRingId"` + // The encryption-key version + KekKeyVersion string `json:"kekKeyVersion"` + ServiceAccount string `json:"serviceAccount"` +} + +type _InstanceEncryption InstanceEncryption + +// NewInstanceEncryption instantiates a new InstanceEncryption object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceEncryption(kekKeyId string, kekKeyRingId string, kekKeyVersion string, serviceAccount string) *InstanceEncryption { + this := InstanceEncryption{} + this.KekKeyId = kekKeyId + this.KekKeyRingId = kekKeyRingId + this.KekKeyVersion = kekKeyVersion + this.ServiceAccount = serviceAccount + return &this +} + +// NewInstanceEncryptionWithDefaults instantiates a new InstanceEncryption object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceEncryptionWithDefaults() *InstanceEncryption { + this := InstanceEncryption{} + return &this +} + +// GetKekKeyId returns the KekKeyId field value +func (o *InstanceEncryption) 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 *InstanceEncryption) GetKekKeyIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KekKeyId, true +} + +// SetKekKeyId sets field value +func (o *InstanceEncryption) SetKekKeyId(v string) { + o.KekKeyId = v +} + +// GetKekKeyRingId returns the KekKeyRingId field value +func (o *InstanceEncryption) 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 *InstanceEncryption) GetKekKeyRingIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KekKeyRingId, true +} + +// SetKekKeyRingId sets field value +func (o *InstanceEncryption) SetKekKeyRingId(v string) { + o.KekKeyRingId = v +} + +// GetKekKeyVersion returns the KekKeyVersion field value +func (o *InstanceEncryption) GetKekKeyVersion() string { + if o == nil { + var ret string + 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 *InstanceEncryption) GetKekKeyVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KekKeyVersion, true +} + +// SetKekKeyVersion sets field value +func (o *InstanceEncryption) SetKekKeyVersion(v string) { + o.KekKeyVersion = v +} + +// GetServiceAccount returns the ServiceAccount field value +func (o *InstanceEncryption) 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 *InstanceEncryption) GetServiceAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ServiceAccount, true +} + +// SetServiceAccount sets field value +func (o *InstanceEncryption) SetServiceAccount(v string) { + o.ServiceAccount = v +} + +func (o InstanceEncryption) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceEncryption) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["kekKeyId"] = o.KekKeyId + toSerialize["kekKeyRingId"] = o.KekKeyRingId + toSerialize["kekKeyVersion"] = o.KekKeyVersion + toSerialize["serviceAccount"] = o.ServiceAccount + return toSerialize, nil +} + +func (o *InstanceEncryption) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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", + "kekKeyRingId", + "kekKeyVersion", + "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) + } + } + + varInstanceEncryption := _InstanceEncryption{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varInstanceEncryption) + + if err != nil { + return err + } + + *o = InstanceEncryption(varInstanceEncryption) + + return err +} + +type NullableInstanceEncryption struct { + value *InstanceEncryption + isSet bool +} + +func (v NullableInstanceEncryption) Get() *InstanceEncryption { + return v.value +} + +func (v *NullableInstanceEncryption) Set(val *InstanceEncryption) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceEncryption) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceEncryption) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceEncryption(val *InstanceEncryption) *NullableInstanceEncryption { + return &NullableInstanceEncryption{value: val, isSet: true} +} + +func (v NullableInstanceEncryption) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceEncryption) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_instance_network.go b/services/postgresflex/v3alpha1api/model_instance_network.go new file mode 100644 index 000000000..30a5882d7 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_instance_network.go @@ -0,0 +1,270 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the InstanceNetwork type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceNetwork{} + +// InstanceNetwork The access configuration of the instance +type InstanceNetwork struct { + AccessScope *InstanceNetworkAccessScope `json:"accessScope,omitempty"` + // List of IPV4 cidr. + Acl []string `json:"acl"` + InstanceAddress *string `json:"instanceAddress,omitempty"` + RouterAddress *string `json:"routerAddress,omitempty"` +} + +type _InstanceNetwork InstanceNetwork + +// NewInstanceNetwork instantiates a new InstanceNetwork object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceNetwork(acl []string) *InstanceNetwork { + this := InstanceNetwork{} + var accessScope InstanceNetworkAccessScope = INSTANCENETWORKACCESSSCOPE_PUBLIC + this.AccessScope = &accessScope + this.Acl = acl + return &this +} + +// NewInstanceNetworkWithDefaults instantiates a new InstanceNetwork object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceNetworkWithDefaults() *InstanceNetwork { + this := InstanceNetwork{} + var accessScope InstanceNetworkAccessScope = INSTANCENETWORKACCESSSCOPE_PUBLIC + this.AccessScope = &accessScope + return &this +} + +// GetAccessScope returns the AccessScope field value if set, zero value otherwise. +func (o *InstanceNetwork) GetAccessScope() InstanceNetworkAccessScope { + if o == nil || IsNil(o.AccessScope) { + var ret InstanceNetworkAccessScope + return ret + } + return *o.AccessScope +} + +// GetAccessScopeOk returns a tuple with the AccessScope field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceNetwork) GetAccessScopeOk() (*InstanceNetworkAccessScope, bool) { + if o == nil || IsNil(o.AccessScope) { + return nil, false + } + return o.AccessScope, true +} + +// HasAccessScope returns a boolean if a field has been set. +func (o *InstanceNetwork) HasAccessScope() bool { + if o != nil && !IsNil(o.AccessScope) { + return true + } + + return false +} + +// SetAccessScope gets a reference to the given InstanceNetworkAccessScope and assigns it to the AccessScope field. +func (o *InstanceNetwork) SetAccessScope(v InstanceNetworkAccessScope) { + o.AccessScope = &v +} + +// GetAcl returns the Acl field value +func (o *InstanceNetwork) GetAcl() []string { + if o == nil { + var ret []string + return ret + } + + return o.Acl +} + +// GetAclOk returns a tuple with the Acl field value +// and a boolean to check if the value has been set. +func (o *InstanceNetwork) GetAclOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Acl, true +} + +// SetAcl sets field value +func (o *InstanceNetwork) SetAcl(v []string) { + o.Acl = v +} + +// GetInstanceAddress returns the InstanceAddress field value if set, zero value otherwise. +func (o *InstanceNetwork) GetInstanceAddress() string { + if o == nil || IsNil(o.InstanceAddress) { + var ret string + return ret + } + return *o.InstanceAddress +} + +// GetInstanceAddressOk returns a tuple with the InstanceAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceNetwork) GetInstanceAddressOk() (*string, bool) { + if o == nil || IsNil(o.InstanceAddress) { + return nil, false + } + return o.InstanceAddress, true +} + +// HasInstanceAddress returns a boolean if a field has been set. +func (o *InstanceNetwork) HasInstanceAddress() bool { + if o != nil && !IsNil(o.InstanceAddress) { + return true + } + + return false +} + +// SetInstanceAddress gets a reference to the given string and assigns it to the InstanceAddress field. +func (o *InstanceNetwork) SetInstanceAddress(v string) { + o.InstanceAddress = &v +} + +// GetRouterAddress returns the RouterAddress field value if set, zero value otherwise. +func (o *InstanceNetwork) GetRouterAddress() string { + if o == nil || IsNil(o.RouterAddress) { + var ret string + return ret + } + return *o.RouterAddress +} + +// GetRouterAddressOk returns a tuple with the RouterAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceNetwork) GetRouterAddressOk() (*string, bool) { + if o == nil || IsNil(o.RouterAddress) { + return nil, false + } + return o.RouterAddress, true +} + +// HasRouterAddress returns a boolean if a field has been set. +func (o *InstanceNetwork) HasRouterAddress() bool { + if o != nil && !IsNil(o.RouterAddress) { + return true + } + + return false +} + +// SetRouterAddress gets a reference to the given string and assigns it to the RouterAddress field. +func (o *InstanceNetwork) SetRouterAddress(v string) { + o.RouterAddress = &v +} + +func (o InstanceNetwork) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceNetwork) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AccessScope) { + toSerialize["accessScope"] = o.AccessScope + } + toSerialize["acl"] = o.Acl + if !IsNil(o.InstanceAddress) { + toSerialize["instanceAddress"] = o.InstanceAddress + } + if !IsNil(o.RouterAddress) { + toSerialize["routerAddress"] = o.RouterAddress + } + return toSerialize, nil +} + +func (o *InstanceNetwork) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "acl", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInstanceNetwork := _InstanceNetwork{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varInstanceNetwork) + + if err != nil { + return err + } + + *o = InstanceNetwork(varInstanceNetwork) + + return err +} + +type NullableInstanceNetwork struct { + value *InstanceNetwork + isSet bool +} + +func (v NullableInstanceNetwork) Get() *InstanceNetwork { + return v.value +} + +func (v *NullableInstanceNetwork) Set(val *InstanceNetwork) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceNetwork) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceNetwork) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceNetwork(val *InstanceNetwork) *NullableInstanceNetwork { + return &NullableInstanceNetwork{value: val, isSet: true} +} + +func (v NullableInstanceNetwork) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceNetwork) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_instance_network_access_scope.go b/services/postgresflex/v3alpha1api/model_instance_network_access_scope.go new file mode 100644 index 000000000..5feb464db --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_instance_network_access_scope.go @@ -0,0 +1,111 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "encoding/json" + "fmt" +) + +// InstanceNetworkAccessScope The access scope of the instance. It defines if the instance is public or airgapped. +type InstanceNetworkAccessScope string + +// List of instance.network.accessScope +const ( + INSTANCENETWORKACCESSSCOPE_PUBLIC InstanceNetworkAccessScope = "PUBLIC" + INSTANCENETWORKACCESSSCOPE_SNA InstanceNetworkAccessScope = "SNA" +) + +// All allowed values of InstanceNetworkAccessScope enum +var AllowedInstanceNetworkAccessScopeEnumValues = []InstanceNetworkAccessScope{ + "PUBLIC", + "SNA", +} + +func (v *InstanceNetworkAccessScope) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceNetworkAccessScope(value) + for _, existing := range AllowedInstanceNetworkAccessScopeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InstanceNetworkAccessScope", value) +} + +// NewInstanceNetworkAccessScopeFromValue returns a pointer to a valid InstanceNetworkAccessScope +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceNetworkAccessScopeFromValue(v string) (*InstanceNetworkAccessScope, error) { + ev := InstanceNetworkAccessScope(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceNetworkAccessScope: valid values are %v", v, AllowedInstanceNetworkAccessScopeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceNetworkAccessScope) IsValid() bool { + for _, existing := range AllowedInstanceNetworkAccessScopeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to instance.network.accessScope value +func (v InstanceNetworkAccessScope) Ptr() *InstanceNetworkAccessScope { + return &v +} + +type NullableInstanceNetworkAccessScope struct { + value *InstanceNetworkAccessScope + isSet bool +} + +func (v NullableInstanceNetworkAccessScope) Get() *InstanceNetworkAccessScope { + return v.value +} + +func (v *NullableInstanceNetworkAccessScope) Set(val *InstanceNetworkAccessScope) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceNetworkAccessScope) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceNetworkAccessScope) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceNetworkAccessScope(val *InstanceNetworkAccessScope) *NullableInstanceNetworkAccessScope { + return &NullableInstanceNetworkAccessScope{value: val, isSet: true} +} + +func (v NullableInstanceNetworkAccessScope) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceNetworkAccessScope) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_instance_network_create.go b/services/postgresflex/v3alpha1api/model_instance_network_create.go new file mode 100644 index 000000000..33750f46c --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_instance_network_create.go @@ -0,0 +1,198 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the InstanceNetworkCreate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceNetworkCreate{} + +// InstanceNetworkCreate The access configuration of the instance +type InstanceNetworkCreate struct { + AccessScope *InstanceNetworkAccessScope `json:"accessScope,omitempty"` + // List of IPV4 cidr. + Acl []string `json:"acl"` +} + +type _InstanceNetworkCreate InstanceNetworkCreate + +// NewInstanceNetworkCreate instantiates a new InstanceNetworkCreate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceNetworkCreate(acl []string) *InstanceNetworkCreate { + this := InstanceNetworkCreate{} + var accessScope InstanceNetworkAccessScope = INSTANCENETWORKACCESSSCOPE_PUBLIC + this.AccessScope = &accessScope + this.Acl = acl + return &this +} + +// NewInstanceNetworkCreateWithDefaults instantiates a new InstanceNetworkCreate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceNetworkCreateWithDefaults() *InstanceNetworkCreate { + this := InstanceNetworkCreate{} + var accessScope InstanceNetworkAccessScope = INSTANCENETWORKACCESSSCOPE_PUBLIC + this.AccessScope = &accessScope + return &this +} + +// GetAccessScope returns the AccessScope field value if set, zero value otherwise. +func (o *InstanceNetworkCreate) GetAccessScope() InstanceNetworkAccessScope { + if o == nil || IsNil(o.AccessScope) { + var ret InstanceNetworkAccessScope + return ret + } + return *o.AccessScope +} + +// GetAccessScopeOk returns a tuple with the AccessScope field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceNetworkCreate) GetAccessScopeOk() (*InstanceNetworkAccessScope, bool) { + if o == nil || IsNil(o.AccessScope) { + return nil, false + } + return o.AccessScope, true +} + +// HasAccessScope returns a boolean if a field has been set. +func (o *InstanceNetworkCreate) HasAccessScope() bool { + if o != nil && !IsNil(o.AccessScope) { + return true + } + + return false +} + +// SetAccessScope gets a reference to the given InstanceNetworkAccessScope and assigns it to the AccessScope field. +func (o *InstanceNetworkCreate) SetAccessScope(v InstanceNetworkAccessScope) { + o.AccessScope = &v +} + +// GetAcl returns the Acl field value +func (o *InstanceNetworkCreate) GetAcl() []string { + if o == nil { + var ret []string + return ret + } + + return o.Acl +} + +// GetAclOk returns a tuple with the Acl field value +// and a boolean to check if the value has been set. +func (o *InstanceNetworkCreate) GetAclOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Acl, true +} + +// SetAcl sets field value +func (o *InstanceNetworkCreate) SetAcl(v []string) { + o.Acl = v +} + +func (o InstanceNetworkCreate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceNetworkCreate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AccessScope) { + toSerialize["accessScope"] = o.AccessScope + } + toSerialize["acl"] = o.Acl + return toSerialize, nil +} + +func (o *InstanceNetworkCreate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "acl", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInstanceNetworkCreate := _InstanceNetworkCreate{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varInstanceNetworkCreate) + + if err != nil { + return err + } + + *o = InstanceNetworkCreate(varInstanceNetworkCreate) + + return err +} + +type NullableInstanceNetworkCreate struct { + value *InstanceNetworkCreate + isSet bool +} + +func (v NullableInstanceNetworkCreate) Get() *InstanceNetworkCreate { + return v.value +} + +func (v *NullableInstanceNetworkCreate) Set(val *InstanceNetworkCreate) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceNetworkCreate) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceNetworkCreate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceNetworkCreate(val *InstanceNetworkCreate) *NullableInstanceNetworkCreate { + return &NullableInstanceNetworkCreate{value: val, isSet: true} +} + +func (v NullableInstanceNetworkCreate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceNetworkCreate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_instance_network_opt.go b/services/postgresflex/v3alpha1api/model_instance_network_opt.go new file mode 100644 index 000000000..704894412 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_instance_network_opt.go @@ -0,0 +1,126 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "encoding/json" +) + +// checks if the InstanceNetworkOpt type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceNetworkOpt{} + +// InstanceNetworkOpt The access configuration of the instance +type InstanceNetworkOpt struct { + // List of IPV4 cidr. + Acl []string `json:"acl,omitempty"` +} + +// NewInstanceNetworkOpt instantiates a new InstanceNetworkOpt object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceNetworkOpt() *InstanceNetworkOpt { + this := InstanceNetworkOpt{} + return &this +} + +// NewInstanceNetworkOptWithDefaults instantiates a new InstanceNetworkOpt object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceNetworkOptWithDefaults() *InstanceNetworkOpt { + this := InstanceNetworkOpt{} + return &this +} + +// GetAcl returns the Acl field value if set, zero value otherwise. +func (o *InstanceNetworkOpt) GetAcl() []string { + if o == nil || IsNil(o.Acl) { + var ret []string + return ret + } + return o.Acl +} + +// GetAclOk returns a tuple with the Acl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceNetworkOpt) GetAclOk() ([]string, bool) { + if o == nil || IsNil(o.Acl) { + return nil, false + } + return o.Acl, true +} + +// HasAcl returns a boolean if a field has been set. +func (o *InstanceNetworkOpt) HasAcl() bool { + if o != nil && !IsNil(o.Acl) { + return true + } + + return false +} + +// SetAcl gets a reference to the given []string and assigns it to the Acl field. +func (o *InstanceNetworkOpt) SetAcl(v []string) { + o.Acl = v +} + +func (o InstanceNetworkOpt) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceNetworkOpt) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Acl) { + toSerialize["acl"] = o.Acl + } + return toSerialize, nil +} + +type NullableInstanceNetworkOpt struct { + value *InstanceNetworkOpt + isSet bool +} + +func (v NullableInstanceNetworkOpt) Get() *InstanceNetworkOpt { + return v.value +} + +func (v *NullableInstanceNetworkOpt) Set(val *InstanceNetworkOpt) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceNetworkOpt) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceNetworkOpt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceNetworkOpt(val *InstanceNetworkOpt) *NullableInstanceNetworkOpt { + return &NullableInstanceNetworkOpt{value: val, isSet: true} +} + +func (v NullableInstanceNetworkOpt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceNetworkOpt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_instance_network_update.go b/services/postgresflex/v3alpha1api/model_instance_network_update.go new file mode 100644 index 000000000..35ee0f515 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_instance_network_update.go @@ -0,0 +1,158 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the InstanceNetworkUpdate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceNetworkUpdate{} + +// InstanceNetworkUpdate The access configuration of the instance +type InstanceNetworkUpdate struct { + // List of IPV4 cidr. + Acl []string `json:"acl"` +} + +type _InstanceNetworkUpdate InstanceNetworkUpdate + +// NewInstanceNetworkUpdate instantiates a new InstanceNetworkUpdate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceNetworkUpdate(acl []string) *InstanceNetworkUpdate { + this := InstanceNetworkUpdate{} + this.Acl = acl + return &this +} + +// NewInstanceNetworkUpdateWithDefaults instantiates a new InstanceNetworkUpdate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceNetworkUpdateWithDefaults() *InstanceNetworkUpdate { + this := InstanceNetworkUpdate{} + return &this +} + +// GetAcl returns the Acl field value +func (o *InstanceNetworkUpdate) GetAcl() []string { + if o == nil { + var ret []string + return ret + } + + return o.Acl +} + +// GetAclOk returns a tuple with the Acl field value +// and a boolean to check if the value has been set. +func (o *InstanceNetworkUpdate) GetAclOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Acl, true +} + +// SetAcl sets field value +func (o *InstanceNetworkUpdate) SetAcl(v []string) { + o.Acl = v +} + +func (o InstanceNetworkUpdate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceNetworkUpdate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["acl"] = o.Acl + return toSerialize, nil +} + +func (o *InstanceNetworkUpdate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "acl", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInstanceNetworkUpdate := _InstanceNetworkUpdate{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varInstanceNetworkUpdate) + + if err != nil { + return err + } + + *o = InstanceNetworkUpdate(varInstanceNetworkUpdate) + + return err +} + +type NullableInstanceNetworkUpdate struct { + value *InstanceNetworkUpdate + isSet bool +} + +func (v NullableInstanceNetworkUpdate) Get() *InstanceNetworkUpdate { + return v.value +} + +func (v *NullableInstanceNetworkUpdate) Set(val *InstanceNetworkUpdate) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceNetworkUpdate) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceNetworkUpdate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceNetworkUpdate(val *InstanceNetworkUpdate) *NullableInstanceNetworkUpdate { + return &NullableInstanceNetworkUpdate{value: val, isSet: true} +} + +func (v NullableInstanceNetworkUpdate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceNetworkUpdate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_instance_sort.go b/services/postgresflex/v3alpha1api/model_instance_sort.go new file mode 100644 index 000000000..e893d0501 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_instance_sort.go @@ -0,0 +1,123 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "encoding/json" + "fmt" +) + +// InstanceSort the model 'InstanceSort' +type InstanceSort string + +// List of instance.sort +const ( + INSTANCESORT_ID_DESC InstanceSort = "id.desc" + INSTANCESORT_ID_ASC InstanceSort = "id.asc" + INSTANCESORT_IS_DELETABLE_DESC InstanceSort = "is_deletable.desc" + INSTANCESORT_IS_DELETABLE_ASC InstanceSort = "is_deletable.asc" + INSTANCESORT_NAME_ASC InstanceSort = "name.asc" + INSTANCESORT_NAME_DESC InstanceSort = "name.desc" + INSTANCESORT_STATUS_ASC InstanceSort = "status.asc" + INSTANCESORT_STATUS_DESC InstanceSort = "status.desc" +) + +// All allowed values of InstanceSort enum +var AllowedInstanceSortEnumValues = []InstanceSort{ + "id.desc", + "id.asc", + "is_deletable.desc", + "is_deletable.asc", + "name.asc", + "name.desc", + "status.asc", + "status.desc", +} + +func (v *InstanceSort) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceSort(value) + for _, existing := range AllowedInstanceSortEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InstanceSort", value) +} + +// NewInstanceSortFromValue returns a pointer to a valid InstanceSort +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceSortFromValue(v string) (*InstanceSort, error) { + ev := InstanceSort(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceSort: valid values are %v", v, AllowedInstanceSortEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceSort) IsValid() bool { + for _, existing := range AllowedInstanceSortEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to instance.sort value +func (v InstanceSort) Ptr() *InstanceSort { + return &v +} + +type NullableInstanceSort struct { + value *InstanceSort + isSet bool +} + +func (v NullableInstanceSort) Get() *InstanceSort { + return v.value +} + +func (v *NullableInstanceSort) Set(val *InstanceSort) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceSort) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceSort) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceSort(val *InstanceSort) *NullableInstanceSort { + return &NullableInstanceSort{value: val, isSet: true} +} + +func (v NullableInstanceSort) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceSort) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_instance_storage_range.go b/services/postgresflex/v3alpha1api/model_instance_storage_range.go new file mode 100644 index 000000000..9e25298ba --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_instance_storage_range.go @@ -0,0 +1,187 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the InstanceStorageRange type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceStorageRange{} + +// InstanceStorageRange Contains the minimum and maximum storage space. +type InstanceStorageRange struct { + // The maximum available amount of storage. + Max int32 `json:"max"` + // The minimum available amount of storage. + Min int32 `json:"min"` +} + +type _InstanceStorageRange InstanceStorageRange + +// NewInstanceStorageRange instantiates a new InstanceStorageRange object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceStorageRange(max int32, min int32) *InstanceStorageRange { + this := InstanceStorageRange{} + this.Max = max + this.Min = min + return &this +} + +// NewInstanceStorageRangeWithDefaults instantiates a new InstanceStorageRange object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceStorageRangeWithDefaults() *InstanceStorageRange { + this := InstanceStorageRange{} + return &this +} + +// GetMax returns the Max field value +func (o *InstanceStorageRange) GetMax() int32 { + if o == nil { + var ret int32 + 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 *InstanceStorageRange) GetMaxOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Max, true +} + +// SetMax sets field value +func (o *InstanceStorageRange) SetMax(v int32) { + o.Max = v +} + +// GetMin returns the Min field value +func (o *InstanceStorageRange) GetMin() int32 { + if o == nil { + var ret int32 + 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 *InstanceStorageRange) GetMinOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Min, true +} + +// SetMin sets field value +func (o *InstanceStorageRange) SetMin(v int32) { + o.Min = v +} + +func (o InstanceStorageRange) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceStorageRange) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["max"] = o.Max + toSerialize["min"] = o.Min + return toSerialize, nil +} + +func (o *InstanceStorageRange) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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) + } + } + + varInstanceStorageRange := _InstanceStorageRange{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varInstanceStorageRange) + + if err != nil { + return err + } + + *o = InstanceStorageRange(varInstanceStorageRange) + + return err +} + +type NullableInstanceStorageRange struct { + value *InstanceStorageRange + isSet bool +} + +func (v NullableInstanceStorageRange) Get() *InstanceStorageRange { + return v.value +} + +func (v *NullableInstanceStorageRange) Set(val *InstanceStorageRange) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceStorageRange) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceStorageRange) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceStorageRange(val *InstanceStorageRange) *NullableInstanceStorageRange { + return &NullableInstanceStorageRange{value: val, isSet: true} +} + +func (v NullableInstanceStorageRange) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceStorageRange) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_list_backup.go b/services/postgresflex/v3alpha1api/model_list_backup.go new file mode 100644 index 000000000..572ff327e --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_list_backup.go @@ -0,0 +1,303 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ListBackup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListBackup{} + +// ListBackup struct for ListBackup +type ListBackup struct { + // The time when the backup was completed in RFC3339 format. + CompletionTime string `json:"completionTime"` + // The ID of the backup. + Id int32 `json:"id"` + // The name of the backup. + Name string `json:"name"` + // The time until the backup will be retained. + RetainedUntil string `json:"retainedUntil"` + // The size of the backup in bytes. + Size int32 `json:"size"` + // The type of the backup, which can be automated or manual triggered. + Type string `json:"type"` +} + +type _ListBackup ListBackup + +// NewListBackup instantiates a new ListBackup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListBackup(completionTime string, id int32, name string, retainedUntil string, size int32, types string) *ListBackup { + this := ListBackup{} + this.CompletionTime = completionTime + this.Id = id + this.Name = name + this.RetainedUntil = retainedUntil + this.Size = size + this.Type = types + return &this +} + +// NewListBackupWithDefaults instantiates a new ListBackup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListBackupWithDefaults() *ListBackup { + this := ListBackup{} + return &this +} + +// GetCompletionTime returns the CompletionTime field value +func (o *ListBackup) GetCompletionTime() string { + if o == nil { + var ret string + return ret + } + + return o.CompletionTime +} + +// GetCompletionTimeOk returns a tuple with the CompletionTime field value +// and a boolean to check if the value has been set. +func (o *ListBackup) GetCompletionTimeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CompletionTime, true +} + +// SetCompletionTime sets field value +func (o *ListBackup) SetCompletionTime(v string) { + o.CompletionTime = v +} + +// GetId returns the Id field value +func (o *ListBackup) GetId() int32 { + if o == nil { + var ret int32 + 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 *ListBackup) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ListBackup) SetId(v int32) { + o.Id = v +} + +// GetName returns the Name field value +func (o *ListBackup) 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 *ListBackup) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ListBackup) SetName(v string) { + o.Name = v +} + +// GetRetainedUntil returns the RetainedUntil field value +func (o *ListBackup) GetRetainedUntil() string { + if o == nil { + var ret string + return ret + } + + return o.RetainedUntil +} + +// GetRetainedUntilOk returns a tuple with the RetainedUntil field value +// and a boolean to check if the value has been set. +func (o *ListBackup) GetRetainedUntilOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RetainedUntil, true +} + +// SetRetainedUntil sets field value +func (o *ListBackup) SetRetainedUntil(v string) { + o.RetainedUntil = v +} + +// GetSize returns the Size field value +func (o *ListBackup) GetSize() int32 { + if o == nil { + var ret int32 + 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 *ListBackup) GetSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value +func (o *ListBackup) SetSize(v int32) { + o.Size = v +} + +// GetType returns the Type field value +func (o *ListBackup) 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 *ListBackup) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *ListBackup) SetType(v string) { + o.Type = v +} + +func (o ListBackup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListBackup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["completionTime"] = o.CompletionTime + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["retainedUntil"] = o.RetainedUntil + toSerialize["size"] = o.Size + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *ListBackup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "completionTime", + "id", + "name", + "retainedUntil", + "size", + "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) + } + } + + varListBackup := _ListBackup{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListBackup) + + if err != nil { + return err + } + + *o = ListBackup(varListBackup) + + return err +} + +type NullableListBackup struct { + value *ListBackup + isSet bool +} + +func (v NullableListBackup) Get() *ListBackup { + return v.value +} + +func (v *NullableListBackup) Set(val *ListBackup) { + v.value = val + v.isSet = true +} + +func (v NullableListBackup) IsSet() bool { + return v.isSet +} + +func (v *NullableListBackup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListBackup(val *ListBackup) *NullableListBackup { + return &NullableListBackup{value: val, isSet: true} +} + +func (v NullableListBackup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListBackup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_list_backup_response.go b/services/postgresflex/v3alpha1api/model_list_backup_response.go new file mode 100644 index 000000000..c15bfa6ce --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_list_backup_response.go @@ -0,0 +1,186 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ListBackupResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListBackupResponse{} + +// ListBackupResponse struct for ListBackupResponse +type ListBackupResponse struct { + // The list containing the information about the backups. + Backups []ListBackup `json:"backups"` + Pagination Pagination `json:"pagination"` +} + +type _ListBackupResponse ListBackupResponse + +// NewListBackupResponse instantiates a new ListBackupResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListBackupResponse(backups []ListBackup, pagination Pagination) *ListBackupResponse { + this := ListBackupResponse{} + this.Backups = backups + this.Pagination = pagination + return &this +} + +// NewListBackupResponseWithDefaults instantiates a new ListBackupResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListBackupResponseWithDefaults() *ListBackupResponse { + this := ListBackupResponse{} + return &this +} + +// GetBackups returns the Backups field value +func (o *ListBackupResponse) GetBackups() []ListBackup { + if o == nil { + var ret []ListBackup + 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 *ListBackupResponse) GetBackupsOk() ([]ListBackup, bool) { + if o == nil { + return nil, false + } + return o.Backups, true +} + +// SetBackups sets field value +func (o *ListBackupResponse) SetBackups(v []ListBackup) { + o.Backups = v +} + +// GetPagination returns the Pagination field value +func (o *ListBackupResponse) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *ListBackupResponse) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *ListBackupResponse) SetPagination(v Pagination) { + o.Pagination = v +} + +func (o ListBackupResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListBackupResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["backups"] = o.Backups + toSerialize["pagination"] = o.Pagination + return toSerialize, nil +} + +func (o *ListBackupResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "backups", + "pagination", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListBackupResponse := _ListBackupResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListBackupResponse) + + if err != nil { + return err + } + + *o = ListBackupResponse(varListBackupResponse) + + return err +} + +type NullableListBackupResponse struct { + value *ListBackupResponse + isSet bool +} + +func (v NullableListBackupResponse) Get() *ListBackupResponse { + return v.value +} + +func (v *NullableListBackupResponse) Set(val *ListBackupResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListBackupResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListBackupResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListBackupResponse(val *ListBackupResponse) *NullableListBackupResponse { + return &NullableListBackupResponse{value: val, isSet: true} +} + +func (v NullableListBackupResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListBackupResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_list_database.go b/services/postgresflex/v3alpha1api/model_list_database.go new file mode 100644 index 000000000..5ca9ab90f --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_list_database.go @@ -0,0 +1,216 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ListDatabase type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListDatabase{} + +// ListDatabase struct for ListDatabase +type ListDatabase struct { + // The id of the database. + Id int32 `json:"id"` + // The name of the database. + Name string `json:"name"` + // The owner of the database. + Owner string `json:"owner"` +} + +type _ListDatabase ListDatabase + +// NewListDatabase instantiates a new ListDatabase object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListDatabase(id int32, name string, owner string) *ListDatabase { + this := ListDatabase{} + this.Id = id + this.Name = name + this.Owner = owner + return &this +} + +// NewListDatabaseWithDefaults instantiates a new ListDatabase object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListDatabaseWithDefaults() *ListDatabase { + this := ListDatabase{} + return &this +} + +// GetId returns the Id field value +func (o *ListDatabase) GetId() int32 { + if o == nil { + var ret int32 + 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 *ListDatabase) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ListDatabase) SetId(v int32) { + o.Id = v +} + +// GetName returns the Name field value +func (o *ListDatabase) 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 *ListDatabase) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ListDatabase) SetName(v string) { + o.Name = v +} + +// GetOwner returns the Owner field value +func (o *ListDatabase) GetOwner() string { + if o == nil { + var ret string + return ret + } + + return o.Owner +} + +// GetOwnerOk returns a tuple with the Owner field value +// and a boolean to check if the value has been set. +func (o *ListDatabase) GetOwnerOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Owner, true +} + +// SetOwner sets field value +func (o *ListDatabase) SetOwner(v string) { + o.Owner = v +} + +func (o ListDatabase) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListDatabase) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["owner"] = o.Owner + return toSerialize, nil +} + +func (o *ListDatabase) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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", + "owner", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListDatabase := _ListDatabase{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListDatabase) + + if err != nil { + return err + } + + *o = ListDatabase(varListDatabase) + + return err +} + +type NullableListDatabase struct { + value *ListDatabase + isSet bool +} + +func (v NullableListDatabase) Get() *ListDatabase { + return v.value +} + +func (v *NullableListDatabase) Set(val *ListDatabase) { + v.value = val + v.isSet = true +} + +func (v NullableListDatabase) IsSet() bool { + return v.isSet +} + +func (v *NullableListDatabase) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListDatabase(val *ListDatabase) *NullableListDatabase { + return &NullableListDatabase{value: val, isSet: true} +} + +func (v NullableListDatabase) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListDatabase) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_list_databases_response.go b/services/postgresflex/v3alpha1api/model_list_databases_response.go new file mode 100644 index 000000000..28d810da3 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_list_databases_response.go @@ -0,0 +1,186 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ListDatabasesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListDatabasesResponse{} + +// ListDatabasesResponse struct for ListDatabasesResponse +type ListDatabasesResponse struct { + // A list containing all databases for the instance. + Databases []ListDatabase `json:"databases"` + Pagination Pagination `json:"pagination"` +} + +type _ListDatabasesResponse ListDatabasesResponse + +// NewListDatabasesResponse instantiates a new ListDatabasesResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListDatabasesResponse(databases []ListDatabase, pagination Pagination) *ListDatabasesResponse { + this := ListDatabasesResponse{} + this.Databases = databases + this.Pagination = pagination + return &this +} + +// NewListDatabasesResponseWithDefaults instantiates a new ListDatabasesResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListDatabasesResponseWithDefaults() *ListDatabasesResponse { + this := ListDatabasesResponse{} + return &this +} + +// GetDatabases returns the Databases field value +func (o *ListDatabasesResponse) GetDatabases() []ListDatabase { + if o == nil { + var ret []ListDatabase + return ret + } + + return o.Databases +} + +// GetDatabasesOk returns a tuple with the Databases field value +// and a boolean to check if the value has been set. +func (o *ListDatabasesResponse) GetDatabasesOk() ([]ListDatabase, bool) { + if o == nil { + return nil, false + } + return o.Databases, true +} + +// SetDatabases sets field value +func (o *ListDatabasesResponse) SetDatabases(v []ListDatabase) { + o.Databases = v +} + +// GetPagination returns the Pagination field value +func (o *ListDatabasesResponse) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *ListDatabasesResponse) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *ListDatabasesResponse) SetPagination(v Pagination) { + o.Pagination = v +} + +func (o ListDatabasesResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListDatabasesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["databases"] = o.Databases + toSerialize["pagination"] = o.Pagination + return toSerialize, nil +} + +func (o *ListDatabasesResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "databases", + "pagination", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListDatabasesResponse := _ListDatabasesResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListDatabasesResponse) + + if err != nil { + return err + } + + *o = ListDatabasesResponse(varListDatabasesResponse) + + return err +} + +type NullableListDatabasesResponse struct { + value *ListDatabasesResponse + isSet bool +} + +func (v NullableListDatabasesResponse) Get() *ListDatabasesResponse { + return v.value +} + +func (v *NullableListDatabasesResponse) Set(val *ListDatabasesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListDatabasesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListDatabasesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListDatabasesResponse(val *ListDatabasesResponse) *NullableListDatabasesResponse { + return &NullableListDatabasesResponse{value: val, isSet: true} +} + +func (v NullableListDatabasesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListDatabasesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_list_flavors.go b/services/postgresflex/v3alpha1api/model_list_flavors.go new file mode 100644 index 000000000..879376d08 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_list_flavors.go @@ -0,0 +1,361 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ListFlavors type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListFlavors{} + +// ListFlavors The flavor of the instance containing the technical features. +type ListFlavors struct { + // The cpu count of the instance. + Cpu int32 `json:"cpu"` + // The flavor description. + Description string `json:"description"` + // The id of the instance flavor. + Id string `json:"id"` + // maximum storage which can be ordered for the flavor in Gigabyte. + MaxGB int32 `json:"maxGB"` + // The memory of the instance in Gibibyte. + Memory int32 `json:"memory"` + // minimum storage which is required to order in Gigabyte. + MinGB int32 `json:"minGB"` + // defines the nodeType it can be either single or replica + NodeType string `json:"nodeType"` + // maximum storage which can be ordered for the flavor in Gigabyte. + StorageClasses []FlavorStorageClassesStorageClass `json:"storageClasses"` +} + +type _ListFlavors ListFlavors + +// NewListFlavors instantiates a new ListFlavors object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListFlavors(cpu int32, description string, id string, maxGB int32, memory int32, minGB int32, nodeType string, storageClasses []FlavorStorageClassesStorageClass) *ListFlavors { + this := ListFlavors{} + this.Cpu = cpu + this.Description = description + this.Id = id + this.MaxGB = maxGB + this.Memory = memory + this.MinGB = minGB + this.NodeType = nodeType + this.StorageClasses = storageClasses + return &this +} + +// NewListFlavorsWithDefaults instantiates a new ListFlavors object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListFlavorsWithDefaults() *ListFlavors { + this := ListFlavors{} + return &this +} + +// GetCpu returns the Cpu field value +func (o *ListFlavors) GetCpu() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Cpu +} + +// GetCpuOk returns a tuple with the Cpu field value +// and a boolean to check if the value has been set. +func (o *ListFlavors) GetCpuOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Cpu, true +} + +// SetCpu sets field value +func (o *ListFlavors) SetCpu(v int32) { + o.Cpu = v +} + +// GetDescription returns the Description field value +func (o *ListFlavors) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *ListFlavors) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *ListFlavors) SetDescription(v string) { + o.Description = v +} + +// GetId returns the Id field value +func (o *ListFlavors) 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 *ListFlavors) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ListFlavors) SetId(v string) { + o.Id = v +} + +// GetMaxGB returns the MaxGB field value +func (o *ListFlavors) GetMaxGB() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.MaxGB +} + +// GetMaxGBOk returns a tuple with the MaxGB field value +// and a boolean to check if the value has been set. +func (o *ListFlavors) GetMaxGBOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.MaxGB, true +} + +// SetMaxGB sets field value +func (o *ListFlavors) SetMaxGB(v int32) { + o.MaxGB = v +} + +// GetMemory returns the Memory field value +func (o *ListFlavors) GetMemory() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Memory +} + +// GetMemoryOk returns a tuple with the Memory field value +// and a boolean to check if the value has been set. +func (o *ListFlavors) GetMemoryOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Memory, true +} + +// SetMemory sets field value +func (o *ListFlavors) SetMemory(v int32) { + o.Memory = v +} + +// GetMinGB returns the MinGB field value +func (o *ListFlavors) GetMinGB() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.MinGB +} + +// GetMinGBOk returns a tuple with the MinGB field value +// and a boolean to check if the value has been set. +func (o *ListFlavors) GetMinGBOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.MinGB, true +} + +// SetMinGB sets field value +func (o *ListFlavors) SetMinGB(v int32) { + o.MinGB = v +} + +// GetNodeType returns the NodeType field value +func (o *ListFlavors) GetNodeType() string { + if o == nil { + var ret string + return ret + } + + return o.NodeType +} + +// GetNodeTypeOk returns a tuple with the NodeType field value +// and a boolean to check if the value has been set. +func (o *ListFlavors) GetNodeTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.NodeType, true +} + +// SetNodeType sets field value +func (o *ListFlavors) SetNodeType(v string) { + o.NodeType = v +} + +// GetStorageClasses returns the StorageClasses field value +func (o *ListFlavors) GetStorageClasses() []FlavorStorageClassesStorageClass { + if o == nil { + var ret []FlavorStorageClassesStorageClass + return ret + } + + return o.StorageClasses +} + +// GetStorageClassesOk returns a tuple with the StorageClasses field value +// and a boolean to check if the value has been set. +func (o *ListFlavors) GetStorageClassesOk() ([]FlavorStorageClassesStorageClass, bool) { + if o == nil { + return nil, false + } + return o.StorageClasses, true +} + +// SetStorageClasses sets field value +func (o *ListFlavors) SetStorageClasses(v []FlavorStorageClassesStorageClass) { + o.StorageClasses = v +} + +func (o ListFlavors) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListFlavors) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cpu"] = o.Cpu + toSerialize["description"] = o.Description + toSerialize["id"] = o.Id + toSerialize["maxGB"] = o.MaxGB + toSerialize["memory"] = o.Memory + toSerialize["minGB"] = o.MinGB + toSerialize["nodeType"] = o.NodeType + toSerialize["storageClasses"] = o.StorageClasses + return toSerialize, nil +} + +func (o *ListFlavors) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "cpu", + "description", + "id", + "maxGB", + "memory", + "minGB", + "nodeType", + "storageClasses", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListFlavors := _ListFlavors{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListFlavors) + + if err != nil { + return err + } + + *o = ListFlavors(varListFlavors) + + return err +} + +type NullableListFlavors struct { + value *ListFlavors + isSet bool +} + +func (v NullableListFlavors) Get() *ListFlavors { + return v.value +} + +func (v *NullableListFlavors) Set(val *ListFlavors) { + v.value = val + v.isSet = true +} + +func (v NullableListFlavors) IsSet() bool { + return v.isSet +} + +func (v *NullableListFlavors) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListFlavors(val *ListFlavors) *NullableListFlavors { + return &NullableListFlavors{value: val, isSet: true} +} + +func (v NullableListFlavors) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListFlavors) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_list_instance.go b/services/postgresflex/v3alpha1api/model_list_instance.go new file mode 100644 index 000000000..ccf58dd9d --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_list_instance.go @@ -0,0 +1,244 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ListInstance type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListInstance{} + +// ListInstance struct for ListInstance +type ListInstance struct { + // The ID of the instance. + Id string `json:"id"` + // Whether the instance can be deleted or not. + IsDeletable bool `json:"isDeletable"` + // The name of the instance. + Name string `json:"name"` + Status Status `json:"status"` +} + +type _ListInstance ListInstance + +// NewListInstance instantiates a new ListInstance object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListInstance(id string, isDeletable bool, name string, status Status) *ListInstance { + this := ListInstance{} + this.Id = id + this.IsDeletable = isDeletable + this.Name = name + this.Status = status + return &this +} + +// NewListInstanceWithDefaults instantiates a new ListInstance object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListInstanceWithDefaults() *ListInstance { + this := ListInstance{} + return &this +} + +// GetId returns the Id field value +func (o *ListInstance) 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 *ListInstance) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ListInstance) SetId(v string) { + o.Id = v +} + +// GetIsDeletable returns the IsDeletable field value +func (o *ListInstance) GetIsDeletable() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsDeletable +} + +// GetIsDeletableOk returns a tuple with the IsDeletable field value +// and a boolean to check if the value has been set. +func (o *ListInstance) GetIsDeletableOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsDeletable, true +} + +// SetIsDeletable sets field value +func (o *ListInstance) SetIsDeletable(v bool) { + o.IsDeletable = v +} + +// GetName returns the Name field value +func (o *ListInstance) 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 *ListInstance) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ListInstance) SetName(v string) { + o.Name = v +} + +// GetStatus returns the Status field value +func (o *ListInstance) GetStatus() Status { + if o == nil { + var ret Status + 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 *ListInstance) GetStatusOk() (*Status, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *ListInstance) SetStatus(v Status) { + o.Status = v +} + +func (o ListInstance) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListInstance) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["isDeletable"] = o.IsDeletable + toSerialize["name"] = o.Name + toSerialize["status"] = o.Status + return toSerialize, nil +} + +func (o *ListInstance) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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", + "isDeletable", + "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) + } + } + + varListInstance := _ListInstance{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListInstance) + + if err != nil { + return err + } + + *o = ListInstance(varListInstance) + + return err +} + +type NullableListInstance struct { + value *ListInstance + isSet bool +} + +func (v NullableListInstance) Get() *ListInstance { + return v.value +} + +func (v *NullableListInstance) Set(val *ListInstance) { + v.value = val + v.isSet = true +} + +func (v NullableListInstance) IsSet() bool { + return v.isSet +} + +func (v *NullableListInstance) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListInstance(val *ListInstance) *NullableListInstance { + return &NullableListInstance{value: val, isSet: true} +} + +func (v NullableListInstance) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListInstance) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_list_instances_response.go b/services/postgresflex/v3alpha1api/model_list_instances_response.go new file mode 100644 index 000000000..e2e431979 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_list_instances_response.go @@ -0,0 +1,186 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ListInstancesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListInstancesResponse{} + +// ListInstancesResponse struct for ListInstancesResponse +type ListInstancesResponse struct { + // List of owned instances and their current status. + Instances []ListInstance `json:"instances"` + Pagination Pagination `json:"pagination"` +} + +type _ListInstancesResponse ListInstancesResponse + +// NewListInstancesResponse instantiates a new ListInstancesResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListInstancesResponse(instances []ListInstance, pagination Pagination) *ListInstancesResponse { + this := ListInstancesResponse{} + this.Instances = instances + this.Pagination = pagination + return &this +} + +// NewListInstancesResponseWithDefaults instantiates a new ListInstancesResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListInstancesResponseWithDefaults() *ListInstancesResponse { + this := ListInstancesResponse{} + return &this +} + +// GetInstances returns the Instances field value +func (o *ListInstancesResponse) GetInstances() []ListInstance { + if o == nil { + var ret []ListInstance + return ret + } + + return o.Instances +} + +// GetInstancesOk returns a tuple with the Instances field value +// and a boolean to check if the value has been set. +func (o *ListInstancesResponse) GetInstancesOk() ([]ListInstance, bool) { + if o == nil { + return nil, false + } + return o.Instances, true +} + +// SetInstances sets field value +func (o *ListInstancesResponse) SetInstances(v []ListInstance) { + o.Instances = v +} + +// GetPagination returns the Pagination field value +func (o *ListInstancesResponse) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *ListInstancesResponse) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *ListInstancesResponse) SetPagination(v Pagination) { + o.Pagination = v +} + +func (o ListInstancesResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListInstancesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instances"] = o.Instances + toSerialize["pagination"] = o.Pagination + return toSerialize, nil +} + +func (o *ListInstancesResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "instances", + "pagination", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListInstancesResponse := _ListInstancesResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListInstancesResponse) + + if err != nil { + return err + } + + *o = ListInstancesResponse(varListInstancesResponse) + + return err +} + +type NullableListInstancesResponse struct { + value *ListInstancesResponse + isSet bool +} + +func (v NullableListInstancesResponse) Get() *ListInstancesResponse { + return v.value +} + +func (v *NullableListInstancesResponse) Set(val *ListInstancesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListInstancesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListInstancesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListInstancesResponse(val *ListInstancesResponse) *NullableListInstancesResponse { + return &NullableListInstancesResponse{value: val, isSet: true} +} + +func (v NullableListInstancesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListInstancesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_list_roles_response.go b/services/postgresflex/v3alpha1api/model_list_roles_response.go new file mode 100644 index 000000000..d65eab7d9 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_list_roles_response.go @@ -0,0 +1,158 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ListRolesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListRolesResponse{} + +// ListRolesResponse struct for ListRolesResponse +type ListRolesResponse struct { + // List of all role names available in the instance + Roles []string `json:"roles"` +} + +type _ListRolesResponse ListRolesResponse + +// NewListRolesResponse instantiates a new ListRolesResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListRolesResponse(roles []string) *ListRolesResponse { + this := ListRolesResponse{} + this.Roles = roles + return &this +} + +// NewListRolesResponseWithDefaults instantiates a new ListRolesResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListRolesResponseWithDefaults() *ListRolesResponse { + this := ListRolesResponse{} + return &this +} + +// GetRoles returns the Roles field value +func (o *ListRolesResponse) GetRoles() []string { + if o == nil { + var ret []string + return ret + } + + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value +// and a boolean to check if the value has been set. +func (o *ListRolesResponse) GetRolesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Roles, true +} + +// SetRoles sets field value +func (o *ListRolesResponse) SetRoles(v []string) { + o.Roles = v +} + +func (o ListRolesResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListRolesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["roles"] = o.Roles + return toSerialize, nil +} + +func (o *ListRolesResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "roles", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListRolesResponse := _ListRolesResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListRolesResponse) + + if err != nil { + return err + } + + *o = ListRolesResponse(varListRolesResponse) + + return err +} + +type NullableListRolesResponse struct { + value *ListRolesResponse + isSet bool +} + +func (v NullableListRolesResponse) Get() *ListRolesResponse { + return v.value +} + +func (v *NullableListRolesResponse) Set(val *ListRolesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListRolesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListRolesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListRolesResponse(val *ListRolesResponse) *NullableListRolesResponse { + return &NullableListRolesResponse{value: val, isSet: true} +} + +func (v NullableListRolesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListRolesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_list_user.go b/services/postgresflex/v3alpha1api/model_list_user.go new file mode 100644 index 000000000..75ac54ea1 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_list_user.go @@ -0,0 +1,216 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ListUser type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListUser{} + +// ListUser struct for ListUser +type ListUser struct { + // The ID of the user. + Id int32 `json:"id"` + // The name of the user. + Name string `json:"name"` + // The current status of the user. + Status string `json:"status"` +} + +type _ListUser ListUser + +// NewListUser instantiates a new ListUser object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListUser(id int32, name string, status string) *ListUser { + this := ListUser{} + this.Id = id + this.Name = name + this.Status = status + return &this +} + +// NewListUserWithDefaults instantiates a new ListUser object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListUserWithDefaults() *ListUser { + this := ListUser{} + return &this +} + +// GetId returns the Id field value +func (o *ListUser) GetId() int32 { + if o == nil { + var ret int32 + 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 *ListUser) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ListUser) SetId(v int32) { + o.Id = v +} + +// GetName returns the Name field value +func (o *ListUser) 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 *ListUser) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ListUser) SetName(v string) { + o.Name = v +} + +// GetStatus returns the Status field value +func (o *ListUser) 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 *ListUser) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *ListUser) SetStatus(v string) { + o.Status = v +} + +func (o ListUser) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListUser) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["status"] = o.Status + return toSerialize, nil +} + +func (o *ListUser) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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) + } + } + + varListUser := _ListUser{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListUser) + + if err != nil { + return err + } + + *o = ListUser(varListUser) + + return err +} + +type NullableListUser struct { + value *ListUser + isSet bool +} + +func (v NullableListUser) Get() *ListUser { + return v.value +} + +func (v *NullableListUser) Set(val *ListUser) { + v.value = val + v.isSet = true +} + +func (v NullableListUser) IsSet() bool { + return v.isSet +} + +func (v *NullableListUser) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListUser(val *ListUser) *NullableListUser { + return &NullableListUser{value: val, isSet: true} +} + +func (v NullableListUser) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListUser) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_list_user_response.go b/services/postgresflex/v3alpha1api/model_list_user_response.go new file mode 100644 index 000000000..0f37eada2 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_list_user_response.go @@ -0,0 +1,186 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ListUserResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListUserResponse{} + +// ListUserResponse struct for ListUserResponse +type ListUserResponse struct { + Pagination Pagination `json:"pagination"` + // List of all users inside an instance + Users []ListUser `json:"users"` +} + +type _ListUserResponse ListUserResponse + +// NewListUserResponse instantiates a new ListUserResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListUserResponse(pagination Pagination, users []ListUser) *ListUserResponse { + this := ListUserResponse{} + this.Pagination = pagination + this.Users = users + return &this +} + +// NewListUserResponseWithDefaults instantiates a new ListUserResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListUserResponseWithDefaults() *ListUserResponse { + this := ListUserResponse{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *ListUserResponse) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *ListUserResponse) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *ListUserResponse) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetUsers returns the Users field value +func (o *ListUserResponse) GetUsers() []ListUser { + if o == nil { + var ret []ListUser + return ret + } + + return o.Users +} + +// GetUsersOk returns a tuple with the Users field value +// and a boolean to check if the value has been set. +func (o *ListUserResponse) GetUsersOk() ([]ListUser, bool) { + if o == nil { + return nil, false + } + return o.Users, true +} + +// SetUsers sets field value +func (o *ListUserResponse) SetUsers(v []ListUser) { + o.Users = v +} + +func (o ListUserResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListUserResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["users"] = o.Users + return toSerialize, nil +} + +func (o *ListUserResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "users", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListUserResponse := _ListUserResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListUserResponse) + + if err != nil { + return err + } + + *o = ListUserResponse(varListUserResponse) + + return err +} + +type NullableListUserResponse struct { + value *ListUserResponse + isSet bool +} + +func (v NullableListUserResponse) Get() *ListUserResponse { + return v.value +} + +func (v *NullableListUserResponse) Set(val *ListUserResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListUserResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListUserResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListUserResponse(val *ListUserResponse) *NullableListUserResponse { + return &NullableListUserResponse{value: val, isSet: true} +} + +func (v NullableListUserResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListUserResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_pagination.go b/services/postgresflex/v3alpha1api/model_pagination.go new file mode 100644 index 000000000..09f1386ee --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_pagination.go @@ -0,0 +1,269 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the Pagination type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Pagination{} + +// Pagination struct for Pagination +type Pagination struct { + Page int32 `json:"page"` + Size int32 `json:"size"` + Sort string `json:"sort"` + TotalPages int32 `json:"totalPages"` + TotalRows int32 `json:"totalRows"` +} + +type _Pagination Pagination + +// NewPagination instantiates a new Pagination object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPagination(page int32, size int32, sort string, totalPages int32, totalRows int32) *Pagination { + this := Pagination{} + this.Page = page + this.Size = size + this.Sort = sort + this.TotalPages = totalPages + this.TotalRows = totalRows + return &this +} + +// NewPaginationWithDefaults instantiates a new Pagination object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginationWithDefaults() *Pagination { + this := Pagination{} + return &this +} + +// GetPage returns the Page field value +func (o *Pagination) GetPage() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Page +} + +// GetPageOk returns a tuple with the Page field value +// and a boolean to check if the value has been set. +func (o *Pagination) GetPageOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Page, true +} + +// SetPage sets field value +func (o *Pagination) SetPage(v int32) { + o.Page = v +} + +// GetSize returns the Size field value +func (o *Pagination) GetSize() int32 { + if o == nil { + var ret int32 + 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 *Pagination) GetSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value +func (o *Pagination) SetSize(v int32) { + o.Size = v +} + +// GetSort returns the Sort field value +func (o *Pagination) GetSort() string { + if o == nil { + var ret string + return ret + } + + return o.Sort +} + +// GetSortOk returns a tuple with the Sort field value +// and a boolean to check if the value has been set. +func (o *Pagination) GetSortOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Sort, true +} + +// SetSort sets field value +func (o *Pagination) SetSort(v string) { + o.Sort = v +} + +// GetTotalPages returns the TotalPages field value +func (o *Pagination) GetTotalPages() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.TotalPages +} + +// GetTotalPagesOk returns a tuple with the TotalPages field value +// and a boolean to check if the value has been set. +func (o *Pagination) GetTotalPagesOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.TotalPages, true +} + +// SetTotalPages sets field value +func (o *Pagination) SetTotalPages(v int32) { + o.TotalPages = v +} + +// GetTotalRows returns the TotalRows field value +func (o *Pagination) GetTotalRows() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.TotalRows +} + +// GetTotalRowsOk returns a tuple with the TotalRows field value +// and a boolean to check if the value has been set. +func (o *Pagination) GetTotalRowsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.TotalRows, true +} + +// SetTotalRows sets field value +func (o *Pagination) SetTotalRows(v int32) { + o.TotalRows = v +} + +func (o Pagination) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Pagination) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["page"] = o.Page + toSerialize["size"] = o.Size + toSerialize["sort"] = o.Sort + toSerialize["totalPages"] = o.TotalPages + toSerialize["totalRows"] = o.TotalRows + return toSerialize, nil +} + +func (o *Pagination) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "page", + "size", + "sort", + "totalPages", + "totalRows", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPagination := _Pagination{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPagination) + + if err != nil { + return err + } + + *o = Pagination(varPagination) + + return err +} + +type NullablePagination struct { + value *Pagination + isSet bool +} + +func (v NullablePagination) Get() *Pagination { + return v.value +} + +func (v *NullablePagination) Set(val *Pagination) { + v.value = val + v.isSet = true +} + +func (v NullablePagination) IsSet() bool { + return v.isSet +} + +func (v *NullablePagination) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePagination(val *Pagination) *NullablePagination { + return &NullablePagination{value: val, isSet: true} +} + +func (v NullablePagination) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePagination) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_protect_instance_request_payload.go b/services/postgresflex/v3alpha1api/model_protect_instance_request_payload.go new file mode 100644 index 000000000..d37c3966f --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_protect_instance_request_payload.go @@ -0,0 +1,158 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ProtectInstanceRequestPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProtectInstanceRequestPayload{} + +// ProtectInstanceRequestPayload struct for ProtectInstanceRequestPayload +type ProtectInstanceRequestPayload struct { + // Protect instance from deletion. + IsDeletable bool `json:"isDeletable"` +} + +type _ProtectInstanceRequestPayload ProtectInstanceRequestPayload + +// NewProtectInstanceRequestPayload instantiates a new ProtectInstanceRequestPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProtectInstanceRequestPayload(isDeletable bool) *ProtectInstanceRequestPayload { + this := ProtectInstanceRequestPayload{} + this.IsDeletable = isDeletable + return &this +} + +// NewProtectInstanceRequestPayloadWithDefaults instantiates a new ProtectInstanceRequestPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProtectInstanceRequestPayloadWithDefaults() *ProtectInstanceRequestPayload { + this := ProtectInstanceRequestPayload{} + return &this +} + +// GetIsDeletable returns the IsDeletable field value +func (o *ProtectInstanceRequestPayload) GetIsDeletable() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsDeletable +} + +// GetIsDeletableOk returns a tuple with the IsDeletable field value +// and a boolean to check if the value has been set. +func (o *ProtectInstanceRequestPayload) GetIsDeletableOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsDeletable, true +} + +// SetIsDeletable sets field value +func (o *ProtectInstanceRequestPayload) SetIsDeletable(v bool) { + o.IsDeletable = v +} + +func (o ProtectInstanceRequestPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ProtectInstanceRequestPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["isDeletable"] = o.IsDeletable + return toSerialize, nil +} + +func (o *ProtectInstanceRequestPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "isDeletable", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varProtectInstanceRequestPayload := _ProtectInstanceRequestPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varProtectInstanceRequestPayload) + + if err != nil { + return err + } + + *o = ProtectInstanceRequestPayload(varProtectInstanceRequestPayload) + + return err +} + +type NullableProtectInstanceRequestPayload struct { + value *ProtectInstanceRequestPayload + isSet bool +} + +func (v NullableProtectInstanceRequestPayload) Get() *ProtectInstanceRequestPayload { + return v.value +} + +func (v *NullableProtectInstanceRequestPayload) Set(val *ProtectInstanceRequestPayload) { + v.value = val + v.isSet = true +} + +func (v NullableProtectInstanceRequestPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableProtectInstanceRequestPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProtectInstanceRequestPayload(val *ProtectInstanceRequestPayload) *NullableProtectInstanceRequestPayload { + return &NullableProtectInstanceRequestPayload{value: val, isSet: true} +} + +func (v NullableProtectInstanceRequestPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProtectInstanceRequestPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_protect_instance_response.go b/services/postgresflex/v3alpha1api/model_protect_instance_response.go new file mode 100644 index 000000000..480a14530 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_protect_instance_response.go @@ -0,0 +1,158 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ProtectInstanceResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProtectInstanceResponse{} + +// ProtectInstanceResponse struct for ProtectInstanceResponse +type ProtectInstanceResponse struct { + // Protect instance from deletion. + IsDeletable bool `json:"isDeletable"` +} + +type _ProtectInstanceResponse ProtectInstanceResponse + +// NewProtectInstanceResponse instantiates a new ProtectInstanceResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProtectInstanceResponse(isDeletable bool) *ProtectInstanceResponse { + this := ProtectInstanceResponse{} + this.IsDeletable = isDeletable + return &this +} + +// NewProtectInstanceResponseWithDefaults instantiates a new ProtectInstanceResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProtectInstanceResponseWithDefaults() *ProtectInstanceResponse { + this := ProtectInstanceResponse{} + return &this +} + +// GetIsDeletable returns the IsDeletable field value +func (o *ProtectInstanceResponse) GetIsDeletable() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsDeletable +} + +// GetIsDeletableOk returns a tuple with the IsDeletable field value +// and a boolean to check if the value has been set. +func (o *ProtectInstanceResponse) GetIsDeletableOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsDeletable, true +} + +// SetIsDeletable sets field value +func (o *ProtectInstanceResponse) SetIsDeletable(v bool) { + o.IsDeletable = v +} + +func (o ProtectInstanceResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ProtectInstanceResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["isDeletable"] = o.IsDeletable + return toSerialize, nil +} + +func (o *ProtectInstanceResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "isDeletable", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varProtectInstanceResponse := _ProtectInstanceResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varProtectInstanceResponse) + + if err != nil { + return err + } + + *o = ProtectInstanceResponse(varProtectInstanceResponse) + + return err +} + +type NullableProtectInstanceResponse struct { + value *ProtectInstanceResponse + isSet bool +} + +func (v NullableProtectInstanceResponse) Get() *ProtectInstanceResponse { + return v.value +} + +func (v *NullableProtectInstanceResponse) Set(val *ProtectInstanceResponse) { + v.value = val + v.isSet = true +} + +func (v NullableProtectInstanceResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableProtectInstanceResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProtectInstanceResponse(val *ProtectInstanceResponse) *NullableProtectInstanceResponse { + return &NullableProtectInstanceResponse{value: val, isSet: true} +} + +func (v NullableProtectInstanceResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProtectInstanceResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_replicas.go b/services/postgresflex/v3alpha1api/model_replicas.go new file mode 100644 index 000000000..a45863963 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_replicas.go @@ -0,0 +1,111 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "encoding/json" + "fmt" +) + +// Replicas How many replicas the instance should have. +type Replicas uint32 + +// List of replicas +const ( + REPLICAS__1 Replicas = 1 + REPLICAS__3 Replicas = 3 +) + +// All allowed values of Replicas enum +var AllowedReplicasEnumValues = []Replicas{ + 1, + 3, +} + +func (v *Replicas) UnmarshalJSON(src []byte) error { + var value uint32 + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := Replicas(value) + for _, existing := range AllowedReplicasEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid Replicas", value) +} + +// NewReplicasFromValue returns a pointer to a valid Replicas +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewReplicasFromValue(v uint32) (*Replicas, error) { + ev := Replicas(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for Replicas: valid values are %v", v, AllowedReplicasEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v Replicas) IsValid() bool { + for _, existing := range AllowedReplicasEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to replicas value +func (v Replicas) Ptr() *Replicas { + return &v +} + +type NullableReplicas struct { + value *Replicas + isSet bool +} + +func (v NullableReplicas) Get() *Replicas { + return v.value +} + +func (v *NullableReplicas) Set(val *Replicas) { + v.value = val + v.isSet = true +} + +func (v NullableReplicas) IsSet() bool { + return v.isSet +} + +func (v *NullableReplicas) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableReplicas(val *Replicas) *NullableReplicas { + return &NullableReplicas{value: val, isSet: true} +} + +func (v NullableReplicas) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableReplicas) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_replicas_opt.go b/services/postgresflex/v3alpha1api/model_replicas_opt.go new file mode 100644 index 000000000..02de85c60 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_replicas_opt.go @@ -0,0 +1,111 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "encoding/json" + "fmt" +) + +// ReplicasOpt How many replicas the instance should have. +type ReplicasOpt uint32 + +// List of replicas.opt +const ( + REPLICASOPT__1 ReplicasOpt = 1 + REPLICASOPT__3 ReplicasOpt = 3 +) + +// All allowed values of ReplicasOpt enum +var AllowedReplicasOptEnumValues = []ReplicasOpt{ + 1, + 3, +} + +func (v *ReplicasOpt) UnmarshalJSON(src []byte) error { + var value uint32 + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ReplicasOpt(value) + for _, existing := range AllowedReplicasOptEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ReplicasOpt", value) +} + +// NewReplicasOptFromValue returns a pointer to a valid ReplicasOpt +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewReplicasOptFromValue(v uint32) (*ReplicasOpt, error) { + ev := ReplicasOpt(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ReplicasOpt: valid values are %v", v, AllowedReplicasOptEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ReplicasOpt) IsValid() bool { + for _, existing := range AllowedReplicasOptEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to replicas.opt value +func (v ReplicasOpt) Ptr() *ReplicasOpt { + return &v +} + +type NullableReplicasOpt struct { + value *ReplicasOpt + isSet bool +} + +func (v NullableReplicasOpt) Get() *ReplicasOpt { + return v.value +} + +func (v *NullableReplicasOpt) Set(val *ReplicasOpt) { + v.value = val + v.isSet = true +} + +func (v NullableReplicasOpt) IsSet() bool { + return v.isSet +} + +func (v *NullableReplicasOpt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableReplicasOpt(val *ReplicasOpt) *NullableReplicasOpt { + return &NullableReplicasOpt{value: val, isSet: true} +} + +func (v NullableReplicasOpt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableReplicasOpt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_reset_user_response.go b/services/postgresflex/v3alpha1api/model_reset_user_response.go new file mode 100644 index 000000000..2abe5f5b0 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_reset_user_response.go @@ -0,0 +1,216 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ResetUserResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ResetUserResponse{} + +// ResetUserResponse struct for ResetUserResponse +type ResetUserResponse struct { + // The name of the user. + Name string `json:"name"` + // The password for the user. + Password string `json:"password"` + // The current status of the user. + Status string `json:"status"` +} + +type _ResetUserResponse ResetUserResponse + +// NewResetUserResponse instantiates a new ResetUserResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewResetUserResponse(name string, password string, status string) *ResetUserResponse { + this := ResetUserResponse{} + this.Name = name + this.Password = password + this.Status = status + return &this +} + +// NewResetUserResponseWithDefaults instantiates a new ResetUserResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewResetUserResponseWithDefaults() *ResetUserResponse { + this := ResetUserResponse{} + return &this +} + +// GetName returns the Name field value +func (o *ResetUserResponse) 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 *ResetUserResponse) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ResetUserResponse) SetName(v string) { + o.Name = v +} + +// GetPassword returns the Password field value +func (o *ResetUserResponse) GetPassword() string { + if o == nil { + var ret string + return ret + } + + return o.Password +} + +// GetPasswordOk returns a tuple with the Password field value +// and a boolean to check if the value has been set. +func (o *ResetUserResponse) GetPasswordOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Password, true +} + +// SetPassword sets field value +func (o *ResetUserResponse) SetPassword(v string) { + o.Password = v +} + +// GetStatus returns the Status field value +func (o *ResetUserResponse) 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 *ResetUserResponse) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *ResetUserResponse) SetStatus(v string) { + o.Status = v +} + +func (o ResetUserResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ResetUserResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["password"] = o.Password + toSerialize["status"] = o.Status + return toSerialize, nil +} + +func (o *ResetUserResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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", + "password", + "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) + } + } + + varResetUserResponse := _ResetUserResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varResetUserResponse) + + if err != nil { + return err + } + + *o = ResetUserResponse(varResetUserResponse) + + return err +} + +type NullableResetUserResponse struct { + value *ResetUserResponse + isSet bool +} + +func (v NullableResetUserResponse) Get() *ResetUserResponse { + return v.value +} + +func (v *NullableResetUserResponse) Set(val *ResetUserResponse) { + v.value = val + v.isSet = true +} + +func (v NullableResetUserResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableResetUserResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResetUserResponse(val *ResetUserResponse) *NullableResetUserResponse { + return &NullableResetUserResponse{value: val, isSet: true} +} + +func (v NullableResetUserResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResetUserResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_status.go b/services/postgresflex/v3alpha1api/model_status.go new file mode 100644 index 000000000..f71fdb6bf --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_status.go @@ -0,0 +1,119 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "encoding/json" + "fmt" +) + +// Status The current status of the instance. +type Status string + +// List of status +const ( + STATUS_READY Status = "READY" + STATUS_PENDING Status = "PENDING" + STATUS_PROGRESSING Status = "PROGRESSING" + STATUS_FAILURE Status = "FAILURE" + STATUS_UNKNOWN Status = "UNKNOWN" + STATUS_TERMINATING Status = "TERMINATING" +) + +// All allowed values of Status enum +var AllowedStatusEnumValues = []Status{ + "READY", + "PENDING", + "PROGRESSING", + "FAILURE", + "UNKNOWN", + "TERMINATING", +} + +func (v *Status) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := Status(value) + for _, existing := range AllowedStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid Status", value) +} + +// NewStatusFromValue returns a pointer to a valid Status +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewStatusFromValue(v string) (*Status, error) { + ev := Status(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for Status: valid values are %v", v, AllowedStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v Status) IsValid() bool { + for _, existing := range AllowedStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to status value +func (v Status) Ptr() *Status { + return &v +} + +type NullableStatus struct { + value *Status + isSet bool +} + +func (v NullableStatus) Get() *Status { + return v.value +} + +func (v *NullableStatus) Set(val *Status) { + v.value = val + v.isSet = true +} + +func (v NullableStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStatus(val *Status) *NullableStatus { + return &NullableStatus{value: val, isSet: true} +} + +func (v NullableStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_storage.go b/services/postgresflex/v3alpha1api/model_storage.go new file mode 100644 index 000000000..0520bd142 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_storage.go @@ -0,0 +1,163 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "encoding/json" +) + +// checks if the Storage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Storage{} + +// Storage The object containing information about the storage size and class. +type Storage struct { + // The storage class for the storage. + PerformanceClass *string `json:"performanceClass,omitempty"` + // The storage size in Gigabytes. + Size *int32 `json:"size,omitempty"` +} + +// NewStorage instantiates a new Storage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStorage() *Storage { + this := Storage{} + return &this +} + +// NewStorageWithDefaults instantiates a new Storage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStorageWithDefaults() *Storage { + this := Storage{} + return &this +} + +// GetPerformanceClass returns the PerformanceClass field value if set, zero value otherwise. +func (o *Storage) 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 *Storage) 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 *Storage) 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 *Storage) SetPerformanceClass(v string) { + o.PerformanceClass = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *Storage) GetSize() int32 { + if o == nil || IsNil(o.Size) { + var ret int32 + 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 *Storage) GetSizeOk() (*int32, 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 *Storage) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int32 and assigns it to the Size field. +func (o *Storage) SetSize(v int32) { + o.Size = &v +} + +func (o Storage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Storage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.PerformanceClass) { + toSerialize["performanceClass"] = o.PerformanceClass + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + return toSerialize, nil +} + +type NullableStorage struct { + value *Storage + isSet bool +} + +func (v NullableStorage) Get() *Storage { + return v.value +} + +func (v *NullableStorage) Set(val *Storage) { + v.value = val + v.isSet = true +} + +func (v NullableStorage) IsSet() bool { + return v.isSet +} + +func (v *NullableStorage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStorage(val *Storage) *NullableStorage { + return &NullableStorage{value: val, isSet: true} +} + +func (v NullableStorage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStorage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_storage_create.go b/services/postgresflex/v3alpha1api/model_storage_create.go new file mode 100644 index 000000000..73719a08b --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_storage_create.go @@ -0,0 +1,187 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the StorageCreate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &StorageCreate{} + +// StorageCreate The object containing information about the storage size and class. +type StorageCreate struct { + // The storage class for the storage. + PerformanceClass string `json:"performanceClass"` + // The storage size in Gigabytes. + Size int32 `json:"size"` +} + +type _StorageCreate StorageCreate + +// NewStorageCreate instantiates a new StorageCreate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStorageCreate(performanceClass string, size int32) *StorageCreate { + this := StorageCreate{} + this.PerformanceClass = performanceClass + this.Size = size + return &this +} + +// NewStorageCreateWithDefaults instantiates a new StorageCreate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStorageCreateWithDefaults() *StorageCreate { + this := StorageCreate{} + return &this +} + +// GetPerformanceClass returns the PerformanceClass field value +func (o *StorageCreate) GetPerformanceClass() string { + if o == nil { + var ret string + return ret + } + + return o.PerformanceClass +} + +// GetPerformanceClassOk returns a tuple with the PerformanceClass field value +// and a boolean to check if the value has been set. +func (o *StorageCreate) GetPerformanceClassOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PerformanceClass, true +} + +// SetPerformanceClass sets field value +func (o *StorageCreate) SetPerformanceClass(v string) { + o.PerformanceClass = v +} + +// GetSize returns the Size field value +func (o *StorageCreate) GetSize() int32 { + if o == nil { + var ret int32 + 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 *StorageCreate) GetSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value +func (o *StorageCreate) SetSize(v int32) { + o.Size = v +} + +func (o StorageCreate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o StorageCreate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["performanceClass"] = o.PerformanceClass + toSerialize["size"] = o.Size + return toSerialize, nil +} + +func (o *StorageCreate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "performanceClass", + "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) + } + } + + varStorageCreate := _StorageCreate{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varStorageCreate) + + if err != nil { + return err + } + + *o = StorageCreate(varStorageCreate) + + return err +} + +type NullableStorageCreate struct { + value *StorageCreate + isSet bool +} + +func (v NullableStorageCreate) Get() *StorageCreate { + return v.value +} + +func (v *NullableStorageCreate) Set(val *StorageCreate) { + v.value = val + v.isSet = true +} + +func (v NullableStorageCreate) IsSet() bool { + return v.isSet +} + +func (v *NullableStorageCreate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStorageCreate(val *StorageCreate) *NullableStorageCreate { + return &NullableStorageCreate{value: val, isSet: true} +} + +func (v NullableStorageCreate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStorageCreate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_storage_update.go b/services/postgresflex/v3alpha1api/model_storage_update.go new file mode 100644 index 000000000..9c3a623da --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_storage_update.go @@ -0,0 +1,126 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "encoding/json" +) + +// checks if the StorageUpdate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &StorageUpdate{} + +// StorageUpdate The object containing information about the storage size and class. +type StorageUpdate struct { + // The storage size in Gigabytes. + Size *int32 `json:"size,omitempty"` +} + +// NewStorageUpdate instantiates a new StorageUpdate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStorageUpdate() *StorageUpdate { + this := StorageUpdate{} + return &this +} + +// NewStorageUpdateWithDefaults instantiates a new StorageUpdate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStorageUpdateWithDefaults() *StorageUpdate { + this := StorageUpdate{} + return &this +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *StorageUpdate) GetSize() int32 { + if o == nil || IsNil(o.Size) { + var ret int32 + 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 *StorageUpdate) GetSizeOk() (*int32, 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 *StorageUpdate) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int32 and assigns it to the Size field. +func (o *StorageUpdate) SetSize(v int32) { + o.Size = &v +} + +func (o StorageUpdate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o StorageUpdate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + return toSerialize, nil +} + +type NullableStorageUpdate struct { + value *StorageUpdate + isSet bool +} + +func (v NullableStorageUpdate) Get() *StorageUpdate { + return v.value +} + +func (v *NullableStorageUpdate) Set(val *StorageUpdate) { + v.value = val + v.isSet = true +} + +func (v NullableStorageUpdate) IsSet() bool { + return v.isSet +} + +func (v *NullableStorageUpdate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStorageUpdate(val *StorageUpdate) *NullableStorageUpdate { + return &NullableStorageUpdate{value: val, isSet: true} +} + +func (v NullableStorageUpdate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStorageUpdate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_update_database_partially_request_payload.go b/services/postgresflex/v3alpha1api/model_update_database_partially_request_payload.go new file mode 100644 index 000000000..33494a054 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_update_database_partially_request_payload.go @@ -0,0 +1,163 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "encoding/json" +) + +// checks if the UpdateDatabasePartiallyRequestPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateDatabasePartiallyRequestPayload{} + +// UpdateDatabasePartiallyRequestPayload struct for UpdateDatabasePartiallyRequestPayload +type UpdateDatabasePartiallyRequestPayload struct { + // The name of the database. + Name *string `json:"name,omitempty"` + // The owner of the database. + Owner *string `json:"owner,omitempty"` +} + +// NewUpdateDatabasePartiallyRequestPayload instantiates a new UpdateDatabasePartiallyRequestPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateDatabasePartiallyRequestPayload() *UpdateDatabasePartiallyRequestPayload { + this := UpdateDatabasePartiallyRequestPayload{} + return &this +} + +// NewUpdateDatabasePartiallyRequestPayloadWithDefaults instantiates a new UpdateDatabasePartiallyRequestPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateDatabasePartiallyRequestPayloadWithDefaults() *UpdateDatabasePartiallyRequestPayload { + this := UpdateDatabasePartiallyRequestPayload{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateDatabasePartiallyRequestPayload) 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 *UpdateDatabasePartiallyRequestPayload) 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 *UpdateDatabasePartiallyRequestPayload) 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 *UpdateDatabasePartiallyRequestPayload) SetName(v string) { + o.Name = &v +} + +// GetOwner returns the Owner field value if set, zero value otherwise. +func (o *UpdateDatabasePartiallyRequestPayload) 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 *UpdateDatabasePartiallyRequestPayload) 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 *UpdateDatabasePartiallyRequestPayload) 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 *UpdateDatabasePartiallyRequestPayload) SetOwner(v string) { + o.Owner = &v +} + +func (o UpdateDatabasePartiallyRequestPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateDatabasePartiallyRequestPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Owner) { + toSerialize["owner"] = o.Owner + } + return toSerialize, nil +} + +type NullableUpdateDatabasePartiallyRequestPayload struct { + value *UpdateDatabasePartiallyRequestPayload + isSet bool +} + +func (v NullableUpdateDatabasePartiallyRequestPayload) Get() *UpdateDatabasePartiallyRequestPayload { + return v.value +} + +func (v *NullableUpdateDatabasePartiallyRequestPayload) Set(val *UpdateDatabasePartiallyRequestPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateDatabasePartiallyRequestPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateDatabasePartiallyRequestPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateDatabasePartiallyRequestPayload(val *UpdateDatabasePartiallyRequestPayload) *NullableUpdateDatabasePartiallyRequestPayload { + return &NullableUpdateDatabasePartiallyRequestPayload{value: val, isSet: true} +} + +func (v NullableUpdateDatabasePartiallyRequestPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateDatabasePartiallyRequestPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_update_database_partially_response.go b/services/postgresflex/v3alpha1api/model_update_database_partially_response.go new file mode 100644 index 000000000..6d431acf7 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_update_database_partially_response.go @@ -0,0 +1,157 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the UpdateDatabasePartiallyResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateDatabasePartiallyResponse{} + +// UpdateDatabasePartiallyResponse struct for UpdateDatabasePartiallyResponse +type UpdateDatabasePartiallyResponse struct { + Database ListDatabase `json:"database"` +} + +type _UpdateDatabasePartiallyResponse UpdateDatabasePartiallyResponse + +// NewUpdateDatabasePartiallyResponse instantiates a new UpdateDatabasePartiallyResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateDatabasePartiallyResponse(database ListDatabase) *UpdateDatabasePartiallyResponse { + this := UpdateDatabasePartiallyResponse{} + this.Database = database + return &this +} + +// NewUpdateDatabasePartiallyResponseWithDefaults instantiates a new UpdateDatabasePartiallyResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateDatabasePartiallyResponseWithDefaults() *UpdateDatabasePartiallyResponse { + this := UpdateDatabasePartiallyResponse{} + return &this +} + +// GetDatabase returns the Database field value +func (o *UpdateDatabasePartiallyResponse) GetDatabase() ListDatabase { + if o == nil { + var ret ListDatabase + return ret + } + + return o.Database +} + +// GetDatabaseOk returns a tuple with the Database field value +// and a boolean to check if the value has been set. +func (o *UpdateDatabasePartiallyResponse) GetDatabaseOk() (*ListDatabase, bool) { + if o == nil { + return nil, false + } + return &o.Database, true +} + +// SetDatabase sets field value +func (o *UpdateDatabasePartiallyResponse) SetDatabase(v ListDatabase) { + o.Database = v +} + +func (o UpdateDatabasePartiallyResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateDatabasePartiallyResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["database"] = o.Database + return toSerialize, nil +} + +func (o *UpdateDatabasePartiallyResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "database", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUpdateDatabasePartiallyResponse := _UpdateDatabasePartiallyResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varUpdateDatabasePartiallyResponse) + + if err != nil { + return err + } + + *o = UpdateDatabasePartiallyResponse(varUpdateDatabasePartiallyResponse) + + return err +} + +type NullableUpdateDatabasePartiallyResponse struct { + value *UpdateDatabasePartiallyResponse + isSet bool +} + +func (v NullableUpdateDatabasePartiallyResponse) Get() *UpdateDatabasePartiallyResponse { + return v.value +} + +func (v *NullableUpdateDatabasePartiallyResponse) Set(val *UpdateDatabasePartiallyResponse) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateDatabasePartiallyResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateDatabasePartiallyResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateDatabasePartiallyResponse(val *UpdateDatabasePartiallyResponse) *NullableUpdateDatabasePartiallyResponse { + return &NullableUpdateDatabasePartiallyResponse{value: val, isSet: true} +} + +func (v NullableUpdateDatabasePartiallyResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateDatabasePartiallyResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_update_database_request_payload.go b/services/postgresflex/v3alpha1api/model_update_database_request_payload.go new file mode 100644 index 000000000..837b6235e --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_update_database_request_payload.go @@ -0,0 +1,187 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the UpdateDatabaseRequestPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateDatabaseRequestPayload{} + +// UpdateDatabaseRequestPayload struct for UpdateDatabaseRequestPayload +type UpdateDatabaseRequestPayload struct { + // The name of the database. + Name string `json:"name"` + // The owner of the database. + Owner string `json:"owner"` +} + +type _UpdateDatabaseRequestPayload UpdateDatabaseRequestPayload + +// NewUpdateDatabaseRequestPayload instantiates a new UpdateDatabaseRequestPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateDatabaseRequestPayload(name string, owner string) *UpdateDatabaseRequestPayload { + this := UpdateDatabaseRequestPayload{} + this.Name = name + this.Owner = owner + return &this +} + +// NewUpdateDatabaseRequestPayloadWithDefaults instantiates a new UpdateDatabaseRequestPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateDatabaseRequestPayloadWithDefaults() *UpdateDatabaseRequestPayload { + this := UpdateDatabaseRequestPayload{} + return &this +} + +// GetName returns the Name field value +func (o *UpdateDatabaseRequestPayload) 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 *UpdateDatabaseRequestPayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *UpdateDatabaseRequestPayload) SetName(v string) { + o.Name = v +} + +// GetOwner returns the Owner field value +func (o *UpdateDatabaseRequestPayload) GetOwner() string { + if o == nil { + var ret string + return ret + } + + return o.Owner +} + +// GetOwnerOk returns a tuple with the Owner field value +// and a boolean to check if the value has been set. +func (o *UpdateDatabaseRequestPayload) GetOwnerOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Owner, true +} + +// SetOwner sets field value +func (o *UpdateDatabaseRequestPayload) SetOwner(v string) { + o.Owner = v +} + +func (o UpdateDatabaseRequestPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateDatabaseRequestPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["owner"] = o.Owner + return toSerialize, nil +} + +func (o *UpdateDatabaseRequestPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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", + "owner", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUpdateDatabaseRequestPayload := _UpdateDatabaseRequestPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varUpdateDatabaseRequestPayload) + + if err != nil { + return err + } + + *o = UpdateDatabaseRequestPayload(varUpdateDatabaseRequestPayload) + + return err +} + +type NullableUpdateDatabaseRequestPayload struct { + value *UpdateDatabaseRequestPayload + isSet bool +} + +func (v NullableUpdateDatabaseRequestPayload) Get() *UpdateDatabaseRequestPayload { + return v.value +} + +func (v *NullableUpdateDatabaseRequestPayload) Set(val *UpdateDatabaseRequestPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateDatabaseRequestPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateDatabaseRequestPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateDatabaseRequestPayload(val *UpdateDatabaseRequestPayload) *NullableUpdateDatabaseRequestPayload { + return &NullableUpdateDatabaseRequestPayload{value: val, isSet: true} +} + +func (v NullableUpdateDatabaseRequestPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateDatabaseRequestPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_update_database_response.go b/services/postgresflex/v3alpha1api/model_update_database_response.go new file mode 100644 index 000000000..e156333a1 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_update_database_response.go @@ -0,0 +1,157 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the UpdateDatabaseResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateDatabaseResponse{} + +// UpdateDatabaseResponse struct for UpdateDatabaseResponse +type UpdateDatabaseResponse struct { + Database ListDatabase `json:"database"` +} + +type _UpdateDatabaseResponse UpdateDatabaseResponse + +// NewUpdateDatabaseResponse instantiates a new UpdateDatabaseResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateDatabaseResponse(database ListDatabase) *UpdateDatabaseResponse { + this := UpdateDatabaseResponse{} + this.Database = database + return &this +} + +// NewUpdateDatabaseResponseWithDefaults instantiates a new UpdateDatabaseResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateDatabaseResponseWithDefaults() *UpdateDatabaseResponse { + this := UpdateDatabaseResponse{} + return &this +} + +// GetDatabase returns the Database field value +func (o *UpdateDatabaseResponse) GetDatabase() ListDatabase { + if o == nil { + var ret ListDatabase + return ret + } + + return o.Database +} + +// GetDatabaseOk returns a tuple with the Database field value +// and a boolean to check if the value has been set. +func (o *UpdateDatabaseResponse) GetDatabaseOk() (*ListDatabase, bool) { + if o == nil { + return nil, false + } + return &o.Database, true +} + +// SetDatabase sets field value +func (o *UpdateDatabaseResponse) SetDatabase(v ListDatabase) { + o.Database = v +} + +func (o UpdateDatabaseResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateDatabaseResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["database"] = o.Database + return toSerialize, nil +} + +func (o *UpdateDatabaseResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "database", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUpdateDatabaseResponse := _UpdateDatabaseResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varUpdateDatabaseResponse) + + if err != nil { + return err + } + + *o = UpdateDatabaseResponse(varUpdateDatabaseResponse) + + return err +} + +type NullableUpdateDatabaseResponse struct { + value *UpdateDatabaseResponse + isSet bool +} + +func (v NullableUpdateDatabaseResponse) Get() *UpdateDatabaseResponse { + return v.value +} + +func (v *NullableUpdateDatabaseResponse) Set(val *UpdateDatabaseResponse) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateDatabaseResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateDatabaseResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateDatabaseResponse(val *UpdateDatabaseResponse) *NullableUpdateDatabaseResponse { + return &NullableUpdateDatabaseResponse{value: val, isSet: true} +} + +func (v NullableUpdateDatabaseResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateDatabaseResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_update_instance_partially_request_payload.go b/services/postgresflex/v3alpha1api/model_update_instance_partially_request_payload.go new file mode 100644 index 000000000..85de5f6a3 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_update_instance_partially_request_payload.go @@ -0,0 +1,382 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "encoding/json" +) + +// checks if the UpdateInstancePartiallyRequestPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateInstancePartiallyRequestPayload{} + +// UpdateInstancePartiallyRequestPayload struct for UpdateInstancePartiallyRequestPayload +type UpdateInstancePartiallyRequestPayload struct { + // The schedule for when the database backup will be created. Currently, ONLY daily schedules are supported (every 24 hours). The schedule is written as a cron schedule. + BackupSchedule *string `json:"backupSchedule,omitempty"` + // The id of the instance flavor. + FlavorId *string `json:"flavorId,omitempty"` + // The name of the instance. + Name *string `json:"name,omitempty"` + Network *InstanceNetworkOpt `json:"network,omitempty"` + Replicas *ReplicasOpt `json:"replicas,omitempty"` + // How long backups are retained. The value can only be between 32 and 365 days. + RetentionDays *int32 `json:"retentionDays,omitempty"` + Storage *StorageUpdate `json:"storage,omitempty"` + // The Postgres version used for the instance. See [Versions Endpoint](/documentation/postgres-flex-service/version/v3alpha1#tag/Version) for supported version parameters. + Version *string `json:"version,omitempty"` +} + +// NewUpdateInstancePartiallyRequestPayload instantiates a new UpdateInstancePartiallyRequestPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateInstancePartiallyRequestPayload() *UpdateInstancePartiallyRequestPayload { + this := UpdateInstancePartiallyRequestPayload{} + return &this +} + +// NewUpdateInstancePartiallyRequestPayloadWithDefaults instantiates a new UpdateInstancePartiallyRequestPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateInstancePartiallyRequestPayloadWithDefaults() *UpdateInstancePartiallyRequestPayload { + this := UpdateInstancePartiallyRequestPayload{} + return &this +} + +// GetBackupSchedule returns the BackupSchedule field value if set, zero value otherwise. +func (o *UpdateInstancePartiallyRequestPayload) GetBackupSchedule() string { + if o == nil || IsNil(o.BackupSchedule) { + var ret string + return ret + } + return *o.BackupSchedule +} + +// GetBackupScheduleOk returns a tuple with the BackupSchedule field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateInstancePartiallyRequestPayload) GetBackupScheduleOk() (*string, bool) { + if o == nil || IsNil(o.BackupSchedule) { + return nil, false + } + return o.BackupSchedule, true +} + +// HasBackupSchedule returns a boolean if a field has been set. +func (o *UpdateInstancePartiallyRequestPayload) HasBackupSchedule() bool { + if o != nil && !IsNil(o.BackupSchedule) { + return true + } + + return false +} + +// SetBackupSchedule gets a reference to the given string and assigns it to the BackupSchedule field. +func (o *UpdateInstancePartiallyRequestPayload) SetBackupSchedule(v string) { + o.BackupSchedule = &v +} + +// GetFlavorId returns the FlavorId field value if set, zero value otherwise. +func (o *UpdateInstancePartiallyRequestPayload) GetFlavorId() string { + if o == nil || IsNil(o.FlavorId) { + var ret string + return ret + } + return *o.FlavorId +} + +// GetFlavorIdOk returns a tuple with the FlavorId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateInstancePartiallyRequestPayload) GetFlavorIdOk() (*string, bool) { + if o == nil || IsNil(o.FlavorId) { + return nil, false + } + return o.FlavorId, true +} + +// HasFlavorId returns a boolean if a field has been set. +func (o *UpdateInstancePartiallyRequestPayload) HasFlavorId() bool { + if o != nil && !IsNil(o.FlavorId) { + return true + } + + return false +} + +// SetFlavorId gets a reference to the given string and assigns it to the FlavorId field. +func (o *UpdateInstancePartiallyRequestPayload) SetFlavorId(v string) { + o.FlavorId = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateInstancePartiallyRequestPayload) 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 *UpdateInstancePartiallyRequestPayload) 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 *UpdateInstancePartiallyRequestPayload) 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 *UpdateInstancePartiallyRequestPayload) SetName(v string) { + o.Name = &v +} + +// GetNetwork returns the Network field value if set, zero value otherwise. +func (o *UpdateInstancePartiallyRequestPayload) GetNetwork() InstanceNetworkOpt { + if o == nil || IsNil(o.Network) { + var ret InstanceNetworkOpt + return ret + } + return *o.Network +} + +// GetNetworkOk returns a tuple with the Network field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateInstancePartiallyRequestPayload) GetNetworkOk() (*InstanceNetworkOpt, bool) { + if o == nil || IsNil(o.Network) { + return nil, false + } + return o.Network, true +} + +// HasNetwork returns a boolean if a field has been set. +func (o *UpdateInstancePartiallyRequestPayload) HasNetwork() bool { + if o != nil && !IsNil(o.Network) { + return true + } + + return false +} + +// SetNetwork gets a reference to the given InstanceNetworkOpt and assigns it to the Network field. +func (o *UpdateInstancePartiallyRequestPayload) SetNetwork(v InstanceNetworkOpt) { + o.Network = &v +} + +// GetReplicas returns the Replicas field value if set, zero value otherwise. +func (o *UpdateInstancePartiallyRequestPayload) GetReplicas() ReplicasOpt { + if o == nil || IsNil(o.Replicas) { + var ret ReplicasOpt + return ret + } + return *o.Replicas +} + +// GetReplicasOk returns a tuple with the Replicas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateInstancePartiallyRequestPayload) GetReplicasOk() (*ReplicasOpt, bool) { + if o == nil || IsNil(o.Replicas) { + return nil, false + } + return o.Replicas, true +} + +// HasReplicas returns a boolean if a field has been set. +func (o *UpdateInstancePartiallyRequestPayload) HasReplicas() bool { + if o != nil && !IsNil(o.Replicas) { + return true + } + + return false +} + +// SetReplicas gets a reference to the given ReplicasOpt and assigns it to the Replicas field. +func (o *UpdateInstancePartiallyRequestPayload) SetReplicas(v ReplicasOpt) { + o.Replicas = &v +} + +// GetRetentionDays returns the RetentionDays field value if set, zero value otherwise. +func (o *UpdateInstancePartiallyRequestPayload) GetRetentionDays() int32 { + if o == nil || IsNil(o.RetentionDays) { + var ret int32 + return ret + } + return *o.RetentionDays +} + +// GetRetentionDaysOk returns a tuple with the RetentionDays field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateInstancePartiallyRequestPayload) GetRetentionDaysOk() (*int32, bool) { + if o == nil || IsNil(o.RetentionDays) { + return nil, false + } + return o.RetentionDays, true +} + +// HasRetentionDays returns a boolean if a field has been set. +func (o *UpdateInstancePartiallyRequestPayload) HasRetentionDays() bool { + if o != nil && !IsNil(o.RetentionDays) { + return true + } + + return false +} + +// SetRetentionDays gets a reference to the given int32 and assigns it to the RetentionDays field. +func (o *UpdateInstancePartiallyRequestPayload) SetRetentionDays(v int32) { + o.RetentionDays = &v +} + +// GetStorage returns the Storage field value if set, zero value otherwise. +func (o *UpdateInstancePartiallyRequestPayload) GetStorage() StorageUpdate { + if o == nil || IsNil(o.Storage) { + var ret StorageUpdate + return ret + } + return *o.Storage +} + +// GetStorageOk returns a tuple with the Storage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateInstancePartiallyRequestPayload) GetStorageOk() (*StorageUpdate, bool) { + if o == nil || IsNil(o.Storage) { + return nil, false + } + return o.Storage, true +} + +// HasStorage returns a boolean if a field has been set. +func (o *UpdateInstancePartiallyRequestPayload) HasStorage() bool { + if o != nil && !IsNil(o.Storage) { + return true + } + + return false +} + +// SetStorage gets a reference to the given StorageUpdate and assigns it to the Storage field. +func (o *UpdateInstancePartiallyRequestPayload) SetStorage(v StorageUpdate) { + o.Storage = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *UpdateInstancePartiallyRequestPayload) GetVersion() string { + if o == nil || IsNil(o.Version) { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateInstancePartiallyRequestPayload) GetVersionOk() (*string, bool) { + if o == nil || IsNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *UpdateInstancePartiallyRequestPayload) HasVersion() bool { + if o != nil && !IsNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *UpdateInstancePartiallyRequestPayload) SetVersion(v string) { + o.Version = &v +} + +func (o UpdateInstancePartiallyRequestPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateInstancePartiallyRequestPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.BackupSchedule) { + toSerialize["backupSchedule"] = o.BackupSchedule + } + if !IsNil(o.FlavorId) { + toSerialize["flavorId"] = o.FlavorId + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Network) { + toSerialize["network"] = o.Network + } + if !IsNil(o.Replicas) { + toSerialize["replicas"] = o.Replicas + } + if !IsNil(o.RetentionDays) { + toSerialize["retentionDays"] = o.RetentionDays + } + if !IsNil(o.Storage) { + toSerialize["storage"] = o.Storage + } + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + return toSerialize, nil +} + +type NullableUpdateInstancePartiallyRequestPayload struct { + value *UpdateInstancePartiallyRequestPayload + isSet bool +} + +func (v NullableUpdateInstancePartiallyRequestPayload) Get() *UpdateInstancePartiallyRequestPayload { + return v.value +} + +func (v *NullableUpdateInstancePartiallyRequestPayload) Set(val *UpdateInstancePartiallyRequestPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateInstancePartiallyRequestPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateInstancePartiallyRequestPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateInstancePartiallyRequestPayload(val *UpdateInstancePartiallyRequestPayload) *NullableUpdateInstancePartiallyRequestPayload { + return &NullableUpdateInstancePartiallyRequestPayload{value: val, isSet: true} +} + +func (v NullableUpdateInstancePartiallyRequestPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateInstancePartiallyRequestPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_update_instance_request_payload.go b/services/postgresflex/v3alpha1api/model_update_instance_request_payload.go new file mode 100644 index 000000000..45ac0008d --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_update_instance_request_payload.go @@ -0,0 +1,358 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the UpdateInstanceRequestPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateInstanceRequestPayload{} + +// UpdateInstanceRequestPayload struct for UpdateInstanceRequestPayload +type UpdateInstanceRequestPayload struct { + // The schedule for when the database backup will be created. Currently, ONLY daily schedules are supported (every 24 hours). The schedule is written as a cron schedule. + BackupSchedule string `json:"backupSchedule"` + // The id of the instance flavor. + FlavorId string `json:"flavorId"` + // The name of the instance. + Name string `json:"name"` + Network InstanceNetworkUpdate `json:"network"` + Replicas Replicas `json:"replicas"` + // How long backups are retained. The value can only be between 32 and 365 days. + RetentionDays int32 `json:"retentionDays"` + Storage StorageUpdate `json:"storage"` + // The Postgres version used for the instance. See [Versions Endpoint](/documentation/postgres-flex-service/version/v3alpha1#tag/Version) for supported version parameters. + Version string `json:"version"` +} + +type _UpdateInstanceRequestPayload UpdateInstanceRequestPayload + +// NewUpdateInstanceRequestPayload instantiates a new UpdateInstanceRequestPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateInstanceRequestPayload(backupSchedule string, flavorId string, name string, network InstanceNetworkUpdate, replicas Replicas, retentionDays int32, storage StorageUpdate, version string) *UpdateInstanceRequestPayload { + this := UpdateInstanceRequestPayload{} + this.BackupSchedule = backupSchedule + this.FlavorId = flavorId + this.Name = name + this.Network = network + this.Replicas = replicas + this.RetentionDays = retentionDays + this.Storage = storage + this.Version = version + return &this +} + +// NewUpdateInstanceRequestPayloadWithDefaults instantiates a new UpdateInstanceRequestPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateInstanceRequestPayloadWithDefaults() *UpdateInstanceRequestPayload { + this := UpdateInstanceRequestPayload{} + return &this +} + +// GetBackupSchedule returns the BackupSchedule field value +func (o *UpdateInstanceRequestPayload) GetBackupSchedule() string { + if o == nil { + var ret string + return ret + } + + return o.BackupSchedule +} + +// GetBackupScheduleOk returns a tuple with the BackupSchedule field value +// and a boolean to check if the value has been set. +func (o *UpdateInstanceRequestPayload) GetBackupScheduleOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BackupSchedule, true +} + +// SetBackupSchedule sets field value +func (o *UpdateInstanceRequestPayload) SetBackupSchedule(v string) { + o.BackupSchedule = v +} + +// GetFlavorId returns the FlavorId field value +func (o *UpdateInstanceRequestPayload) GetFlavorId() string { + if o == nil { + var ret string + return ret + } + + return o.FlavorId +} + +// GetFlavorIdOk returns a tuple with the FlavorId field value +// and a boolean to check if the value has been set. +func (o *UpdateInstanceRequestPayload) GetFlavorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FlavorId, true +} + +// SetFlavorId sets field value +func (o *UpdateInstanceRequestPayload) SetFlavorId(v string) { + o.FlavorId = v +} + +// GetName returns the Name field value +func (o *UpdateInstanceRequestPayload) 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 *UpdateInstanceRequestPayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *UpdateInstanceRequestPayload) SetName(v string) { + o.Name = v +} + +// GetNetwork returns the Network field value +func (o *UpdateInstanceRequestPayload) GetNetwork() InstanceNetworkUpdate { + if o == nil { + var ret InstanceNetworkUpdate + return ret + } + + return o.Network +} + +// GetNetworkOk returns a tuple with the Network field value +// and a boolean to check if the value has been set. +func (o *UpdateInstanceRequestPayload) GetNetworkOk() (*InstanceNetworkUpdate, bool) { + if o == nil { + return nil, false + } + return &o.Network, true +} + +// SetNetwork sets field value +func (o *UpdateInstanceRequestPayload) SetNetwork(v InstanceNetworkUpdate) { + o.Network = v +} + +// GetReplicas returns the Replicas field value +func (o *UpdateInstanceRequestPayload) GetReplicas() Replicas { + if o == nil { + var ret Replicas + return ret + } + + return o.Replicas +} + +// GetReplicasOk returns a tuple with the Replicas field value +// and a boolean to check if the value has been set. +func (o *UpdateInstanceRequestPayload) GetReplicasOk() (*Replicas, bool) { + if o == nil { + return nil, false + } + return &o.Replicas, true +} + +// SetReplicas sets field value +func (o *UpdateInstanceRequestPayload) SetReplicas(v Replicas) { + o.Replicas = v +} + +// GetRetentionDays returns the RetentionDays field value +func (o *UpdateInstanceRequestPayload) GetRetentionDays() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.RetentionDays +} + +// GetRetentionDaysOk returns a tuple with the RetentionDays field value +// and a boolean to check if the value has been set. +func (o *UpdateInstanceRequestPayload) GetRetentionDaysOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.RetentionDays, true +} + +// SetRetentionDays sets field value +func (o *UpdateInstanceRequestPayload) SetRetentionDays(v int32) { + o.RetentionDays = v +} + +// GetStorage returns the Storage field value +func (o *UpdateInstanceRequestPayload) GetStorage() StorageUpdate { + if o == nil { + var ret StorageUpdate + return ret + } + + return o.Storage +} + +// GetStorageOk returns a tuple with the Storage field value +// and a boolean to check if the value has been set. +func (o *UpdateInstanceRequestPayload) GetStorageOk() (*StorageUpdate, bool) { + if o == nil { + return nil, false + } + return &o.Storage, true +} + +// SetStorage sets field value +func (o *UpdateInstanceRequestPayload) SetStorage(v StorageUpdate) { + o.Storage = v +} + +// GetVersion returns the Version field value +func (o *UpdateInstanceRequestPayload) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *UpdateInstanceRequestPayload) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *UpdateInstanceRequestPayload) SetVersion(v string) { + o.Version = v +} + +func (o UpdateInstanceRequestPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateInstanceRequestPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["backupSchedule"] = o.BackupSchedule + toSerialize["flavorId"] = o.FlavorId + toSerialize["name"] = o.Name + toSerialize["network"] = o.Network + toSerialize["replicas"] = o.Replicas + toSerialize["retentionDays"] = o.RetentionDays + toSerialize["storage"] = o.Storage + toSerialize["version"] = o.Version + return toSerialize, nil +} + +func (o *UpdateInstanceRequestPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "backupSchedule", + "flavorId", + "name", + "network", + "replicas", + "retentionDays", + "storage", + "version", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUpdateInstanceRequestPayload := _UpdateInstanceRequestPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varUpdateInstanceRequestPayload) + + if err != nil { + return err + } + + *o = UpdateInstanceRequestPayload(varUpdateInstanceRequestPayload) + + return err +} + +type NullableUpdateInstanceRequestPayload struct { + value *UpdateInstanceRequestPayload + isSet bool +} + +func (v NullableUpdateInstanceRequestPayload) Get() *UpdateInstanceRequestPayload { + return v.value +} + +func (v *NullableUpdateInstanceRequestPayload) Set(val *UpdateInstanceRequestPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateInstanceRequestPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateInstanceRequestPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateInstanceRequestPayload(val *UpdateInstanceRequestPayload) *NullableUpdateInstanceRequestPayload { + return &NullableUpdateInstanceRequestPayload{value: val, isSet: true} +} + +func (v NullableUpdateInstanceRequestPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateInstanceRequestPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_update_user_partially_request_payload.go b/services/postgresflex/v3alpha1api/model_update_user_partially_request_payload.go new file mode 100644 index 000000000..2dc5d5c71 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_update_user_partially_request_payload.go @@ -0,0 +1,163 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "encoding/json" +) + +// checks if the UpdateUserPartiallyRequestPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateUserPartiallyRequestPayload{} + +// UpdateUserPartiallyRequestPayload struct for UpdateUserPartiallyRequestPayload +type UpdateUserPartiallyRequestPayload struct { + // The name of the user. + Name *string `json:"name,omitempty"` + // A list containing the user roles for the instance. + Roles []UserRole `json:"roles,omitempty"` +} + +// NewUpdateUserPartiallyRequestPayload instantiates a new UpdateUserPartiallyRequestPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateUserPartiallyRequestPayload() *UpdateUserPartiallyRequestPayload { + this := UpdateUserPartiallyRequestPayload{} + return &this +} + +// NewUpdateUserPartiallyRequestPayloadWithDefaults instantiates a new UpdateUserPartiallyRequestPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateUserPartiallyRequestPayloadWithDefaults() *UpdateUserPartiallyRequestPayload { + this := UpdateUserPartiallyRequestPayload{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateUserPartiallyRequestPayload) 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 *UpdateUserPartiallyRequestPayload) 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 *UpdateUserPartiallyRequestPayload) 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 *UpdateUserPartiallyRequestPayload) SetName(v string) { + o.Name = &v +} + +// GetRoles returns the Roles field value if set, zero value otherwise. +func (o *UpdateUserPartiallyRequestPayload) GetRoles() []UserRole { + if o == nil || IsNil(o.Roles) { + var ret []UserRole + return ret + } + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateUserPartiallyRequestPayload) GetRolesOk() ([]UserRole, bool) { + if o == nil || IsNil(o.Roles) { + return nil, false + } + return o.Roles, true +} + +// HasRoles returns a boolean if a field has been set. +func (o *UpdateUserPartiallyRequestPayload) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { + return true + } + + return false +} + +// SetRoles gets a reference to the given []UserRole and assigns it to the Roles field. +func (o *UpdateUserPartiallyRequestPayload) SetRoles(v []UserRole) { + o.Roles = v +} + +func (o UpdateUserPartiallyRequestPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateUserPartiallyRequestPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Roles) { + toSerialize["roles"] = o.Roles + } + return toSerialize, nil +} + +type NullableUpdateUserPartiallyRequestPayload struct { + value *UpdateUserPartiallyRequestPayload + isSet bool +} + +func (v NullableUpdateUserPartiallyRequestPayload) Get() *UpdateUserPartiallyRequestPayload { + return v.value +} + +func (v *NullableUpdateUserPartiallyRequestPayload) Set(val *UpdateUserPartiallyRequestPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateUserPartiallyRequestPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateUserPartiallyRequestPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateUserPartiallyRequestPayload(val *UpdateUserPartiallyRequestPayload) *NullableUpdateUserPartiallyRequestPayload { + return &NullableUpdateUserPartiallyRequestPayload{value: val, isSet: true} +} + +func (v NullableUpdateUserPartiallyRequestPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateUserPartiallyRequestPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_update_user_request_payload.go b/services/postgresflex/v3alpha1api/model_update_user_request_payload.go new file mode 100644 index 000000000..a8ae86396 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_update_user_request_payload.go @@ -0,0 +1,195 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the UpdateUserRequestPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateUserRequestPayload{} + +// UpdateUserRequestPayload struct for UpdateUserRequestPayload +type UpdateUserRequestPayload struct { + // The name of the user. + Name *string `json:"name,omitempty"` + // A list containing the user roles for the instance. + Roles []UserRole `json:"roles"` +} + +type _UpdateUserRequestPayload UpdateUserRequestPayload + +// NewUpdateUserRequestPayload instantiates a new UpdateUserRequestPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateUserRequestPayload(roles []UserRole) *UpdateUserRequestPayload { + this := UpdateUserRequestPayload{} + this.Roles = roles + return &this +} + +// NewUpdateUserRequestPayloadWithDefaults instantiates a new UpdateUserRequestPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateUserRequestPayloadWithDefaults() *UpdateUserRequestPayload { + this := UpdateUserRequestPayload{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateUserRequestPayload) 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 *UpdateUserRequestPayload) 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 *UpdateUserRequestPayload) 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 *UpdateUserRequestPayload) SetName(v string) { + o.Name = &v +} + +// GetRoles returns the Roles field value +func (o *UpdateUserRequestPayload) GetRoles() []UserRole { + if o == nil { + var ret []UserRole + return ret + } + + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value +// and a boolean to check if the value has been set. +func (o *UpdateUserRequestPayload) GetRolesOk() ([]UserRole, bool) { + if o == nil { + return nil, false + } + return o.Roles, true +} + +// SetRoles sets field value +func (o *UpdateUserRequestPayload) SetRoles(v []UserRole) { + o.Roles = v +} + +func (o UpdateUserRequestPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateUserRequestPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + toSerialize["roles"] = o.Roles + return toSerialize, nil +} + +func (o *UpdateUserRequestPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "roles", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUpdateUserRequestPayload := _UpdateUserRequestPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varUpdateUserRequestPayload) + + if err != nil { + return err + } + + *o = UpdateUserRequestPayload(varUpdateUserRequestPayload) + + return err +} + +type NullableUpdateUserRequestPayload struct { + value *UpdateUserRequestPayload + isSet bool +} + +func (v NullableUpdateUserRequestPayload) Get() *UpdateUserRequestPayload { + return v.value +} + +func (v *NullableUpdateUserRequestPayload) Set(val *UpdateUserRequestPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateUserRequestPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateUserRequestPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateUserRequestPayload(val *UpdateUserRequestPayload) *NullableUpdateUserRequestPayload { + return &NullableUpdateUserRequestPayload{value: val, isSet: true} +} + +func (v NullableUpdateUserRequestPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateUserRequestPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_user_role.go b/services/postgresflex/v3alpha1api/model_user_role.go new file mode 100644 index 000000000..0b143a5a7 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_user_role.go @@ -0,0 +1,111 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "encoding/json" + "fmt" +) + +// UserRole The user role for the instance. +type UserRole string + +// List of user.role +const ( + USERROLE_CREATEDB UserRole = "createdb" + USERROLE_LOGIN UserRole = "login" +) + +// All allowed values of UserRole enum +var AllowedUserRoleEnumValues = []UserRole{ + "createdb", + "login", +} + +func (v *UserRole) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := UserRole(value) + for _, existing := range AllowedUserRoleEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid UserRole", value) +} + +// NewUserRoleFromValue returns a pointer to a valid UserRole +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewUserRoleFromValue(v string) (*UserRole, error) { + ev := UserRole(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for UserRole: valid values are %v", v, AllowedUserRoleEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v UserRole) IsValid() bool { + for _, existing := range AllowedUserRoleEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to user.role value +func (v UserRole) Ptr() *UserRole { + return &v +} + +type NullableUserRole struct { + value *UserRole + isSet bool +} + +func (v NullableUserRole) Get() *UserRole { + return v.value +} + +func (v *NullableUserRole) Set(val *UserRole) { + v.value = val + v.isSet = true +} + +func (v NullableUserRole) IsSet() bool { + return v.isSet +} + +func (v *NullableUserRole) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserRole(val *UserRole) *NullableUserRole { + return &NullableUserRole{value: val, isSet: true} +} + +func (v NullableUserRole) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserRole) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_user_sort.go b/services/postgresflex/v3alpha1api/model_user_sort.go new file mode 100644 index 000000000..f42f6a2f3 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_user_sort.go @@ -0,0 +1,119 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "encoding/json" + "fmt" +) + +// UserSort the model 'UserSort' +type UserSort string + +// List of user.sort +const ( + USERSORT_ID_ASC UserSort = "id.asc" + USERSORT_ID_DESC UserSort = "id.desc" + USERSORT_NAME_DESC UserSort = "name.desc" + USERSORT_NAME_ASC UserSort = "name.asc" + USERSORT_STATUS_DESC UserSort = "status.desc" + USERSORT_STATUS_ASC UserSort = "status.asc" +) + +// All allowed values of UserSort enum +var AllowedUserSortEnumValues = []UserSort{ + "id.asc", + "id.desc", + "name.desc", + "name.asc", + "status.desc", + "status.asc", +} + +func (v *UserSort) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := UserSort(value) + for _, existing := range AllowedUserSortEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid UserSort", value) +} + +// NewUserSortFromValue returns a pointer to a valid UserSort +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewUserSortFromValue(v string) (*UserSort, error) { + ev := UserSort(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for UserSort: valid values are %v", v, AllowedUserSortEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v UserSort) IsValid() bool { + for _, existing := range AllowedUserSortEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to user.sort value +func (v UserSort) Ptr() *UserSort { + return &v +} + +type NullableUserSort struct { + value *UserSort + isSet bool +} + +func (v NullableUserSort) Get() *UserSort { + return v.value +} + +func (v *NullableUserSort) Set(val *UserSort) { + v.value = val + v.isSet = true +} + +func (v NullableUserSort) IsSet() bool { + return v.isSet +} + +func (v *NullableUserSort) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserSort(val *UserSort) *NullableUserSort { + return &NullableUserSort{value: val, isSet: true} +} + +func (v NullableUserSort) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserSort) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_validation_error.go b/services/postgresflex/v3alpha1api/model_validation_error.go new file mode 100644 index 000000000..847af0f33 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_validation_error.go @@ -0,0 +1,187 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ValidationError type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ValidationError{} + +// ValidationError struct for ValidationError +type ValidationError struct { + // the http error should be always 422 for validationError + Code int32 `json:"code"` + // errors for all fields where the error happened + Validation []ValidationErrorValidationInner `json:"validation"` +} + +type _ValidationError ValidationError + +// NewValidationError instantiates a new ValidationError object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewValidationError(code int32, validation []ValidationErrorValidationInner) *ValidationError { + this := ValidationError{} + this.Code = code + this.Validation = validation + return &this +} + +// NewValidationErrorWithDefaults instantiates a new ValidationError object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewValidationErrorWithDefaults() *ValidationError { + this := ValidationError{} + return &this +} + +// GetCode returns the Code field value +func (o *ValidationError) GetCode() int32 { + if o == nil { + var ret int32 + 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 *ValidationError) GetCodeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Code, true +} + +// SetCode sets field value +func (o *ValidationError) SetCode(v int32) { + o.Code = v +} + +// GetValidation returns the Validation field value +func (o *ValidationError) GetValidation() []ValidationErrorValidationInner { + if o == nil { + var ret []ValidationErrorValidationInner + return ret + } + + return o.Validation +} + +// GetValidationOk returns a tuple with the Validation field value +// and a boolean to check if the value has been set. +func (o *ValidationError) GetValidationOk() ([]ValidationErrorValidationInner, bool) { + if o == nil { + return nil, false + } + return o.Validation, true +} + +// SetValidation sets field value +func (o *ValidationError) SetValidation(v []ValidationErrorValidationInner) { + o.Validation = v +} + +func (o ValidationError) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ValidationError) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["code"] = o.Code + toSerialize["validation"] = o.Validation + return toSerialize, nil +} + +func (o *ValidationError) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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", + "validation", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varValidationError := _ValidationError{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varValidationError) + + if err != nil { + return err + } + + *o = ValidationError(varValidationError) + + return err +} + +type NullableValidationError struct { + value *ValidationError + isSet bool +} + +func (v NullableValidationError) Get() *ValidationError { + return v.value +} + +func (v *NullableValidationError) Set(val *ValidationError) { + v.value = val + v.isSet = true +} + +func (v NullableValidationError) IsSet() bool { + return v.isSet +} + +func (v *NullableValidationError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableValidationError(val *ValidationError) *NullableValidationError { + return &NullableValidationError{value: val, isSet: true} +} + +func (v NullableValidationError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableValidationError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_validation_error_validation_inner.go b/services/postgresflex/v3alpha1api/model_validation_error_validation_inner.go new file mode 100644 index 000000000..d88ad8500 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_validation_error_validation_inner.go @@ -0,0 +1,185 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ValidationErrorValidationInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ValidationErrorValidationInner{} + +// ValidationErrorValidationInner struct for ValidationErrorValidationInner +type ValidationErrorValidationInner struct { + Field string `json:"field"` + Message string `json:"message"` +} + +type _ValidationErrorValidationInner ValidationErrorValidationInner + +// NewValidationErrorValidationInner instantiates a new ValidationErrorValidationInner object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewValidationErrorValidationInner(field string, message string) *ValidationErrorValidationInner { + this := ValidationErrorValidationInner{} + this.Field = field + this.Message = message + return &this +} + +// NewValidationErrorValidationInnerWithDefaults instantiates a new ValidationErrorValidationInner object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewValidationErrorValidationInnerWithDefaults() *ValidationErrorValidationInner { + this := ValidationErrorValidationInner{} + return &this +} + +// GetField returns the Field field value +func (o *ValidationErrorValidationInner) GetField() string { + if o == nil { + var ret string + return ret + } + + return o.Field +} + +// GetFieldOk returns a tuple with the Field field value +// and a boolean to check if the value has been set. +func (o *ValidationErrorValidationInner) GetFieldOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Field, true +} + +// SetField sets field value +func (o *ValidationErrorValidationInner) SetField(v string) { + o.Field = v +} + +// GetMessage returns the Message field value +func (o *ValidationErrorValidationInner) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *ValidationErrorValidationInner) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *ValidationErrorValidationInner) SetMessage(v string) { + o.Message = v +} + +func (o ValidationErrorValidationInner) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ValidationErrorValidationInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["field"] = o.Field + toSerialize["message"] = o.Message + return toSerialize, nil +} + +func (o *ValidationErrorValidationInner) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "field", + "message", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varValidationErrorValidationInner := _ValidationErrorValidationInner{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varValidationErrorValidationInner) + + if err != nil { + return err + } + + *o = ValidationErrorValidationInner(varValidationErrorValidationInner) + + return err +} + +type NullableValidationErrorValidationInner struct { + value *ValidationErrorValidationInner + isSet bool +} + +func (v NullableValidationErrorValidationInner) Get() *ValidationErrorValidationInner { + return v.value +} + +func (v *NullableValidationErrorValidationInner) Set(val *ValidationErrorValidationInner) { + v.value = val + v.isSet = true +} + +func (v NullableValidationErrorValidationInner) IsSet() bool { + return v.isSet +} + +func (v *NullableValidationErrorValidationInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableValidationErrorValidationInner(val *ValidationErrorValidationInner) *NullableValidationErrorValidationInner { + return &NullableValidationErrorValidationInner{value: val, isSet: true} +} + +func (v NullableValidationErrorValidationInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableValidationErrorValidationInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/model_version.go b/services/postgresflex/v3alpha1api/model_version.go new file mode 100644 index 000000000..a5eeaa429 --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_version.go @@ -0,0 +1,245 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the Version type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Version{} + +// Version The version of the postgres instance and more details. +type Version struct { + // Flag if the version is a beta version. If set the version may contain bugs and is not fully tested. + Beta bool `json:"beta"` + // Timestamp in RFC3339 format which says when the version will no longer be supported by STACKIT. + Deprecated string `json:"deprecated"` + // Flag if the version is recommend by the STACKIT Team. + Recommend bool `json:"recommend"` + // The postgres version used for the instance. + Version string `json:"version"` +} + +type _Version Version + +// NewVersion instantiates a new Version object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVersion(beta bool, deprecated string, recommend bool, version string) *Version { + this := Version{} + this.Beta = beta + this.Deprecated = deprecated + this.Recommend = recommend + this.Version = version + return &this +} + +// NewVersionWithDefaults instantiates a new Version object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVersionWithDefaults() *Version { + this := Version{} + return &this +} + +// GetBeta returns the Beta field value +func (o *Version) GetBeta() bool { + if o == nil { + var ret bool + return ret + } + + return o.Beta +} + +// GetBetaOk returns a tuple with the Beta field value +// and a boolean to check if the value has been set. +func (o *Version) GetBetaOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Beta, true +} + +// SetBeta sets field value +func (o *Version) SetBeta(v bool) { + o.Beta = v +} + +// GetDeprecated returns the Deprecated field value +func (o *Version) GetDeprecated() string { + if o == nil { + var ret string + return ret + } + + return o.Deprecated +} + +// GetDeprecatedOk returns a tuple with the Deprecated field value +// and a boolean to check if the value has been set. +func (o *Version) GetDeprecatedOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Deprecated, true +} + +// SetDeprecated sets field value +func (o *Version) SetDeprecated(v string) { + o.Deprecated = v +} + +// GetRecommend returns the Recommend field value +func (o *Version) GetRecommend() bool { + if o == nil { + var ret bool + return ret + } + + return o.Recommend +} + +// GetRecommendOk returns a tuple with the Recommend field value +// and a boolean to check if the value has been set. +func (o *Version) GetRecommendOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Recommend, true +} + +// SetRecommend sets field value +func (o *Version) SetRecommend(v bool) { + o.Recommend = v +} + +// GetVersion returns the Version field value +func (o *Version) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *Version) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *Version) SetVersion(v string) { + o.Version = v +} + +func (o Version) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Version) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["beta"] = o.Beta + toSerialize["deprecated"] = o.Deprecated + toSerialize["recommend"] = o.Recommend + toSerialize["version"] = o.Version + return toSerialize, nil +} + +func (o *Version) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "beta", + "deprecated", + "recommend", + "version", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVersion := _Version{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varVersion) + + if err != nil { + return err + } + + *o = Version(varVersion) + + return err +} + +type NullableVersion struct { + value *Version + isSet bool +} + +func (v NullableVersion) Get() *Version { + return v.value +} + +func (v *NullableVersion) Set(val *Version) { + v.value = val + v.isSet = true +} + +func (v NullableVersion) IsSet() bool { + return v.isSet +} + +func (v *NullableVersion) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVersion(val *Version) *NullableVersion { + return &NullableVersion{value: val, isSet: true} +} + +func (v NullableVersion) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVersion) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/response.go b/services/postgresflex/v3alpha1api/response.go new file mode 100644 index 000000000..5d5aaecc6 --- /dev/null +++ b/services/postgresflex/v3alpha1api/response.go @@ -0,0 +1,48 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +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/postgresflex/v3alpha1api/utils.go b/services/postgresflex/v3alpha1api/utils.go new file mode 100644 index 000000000..55109af75 --- /dev/null +++ b/services/postgresflex/v3alpha1api/utils.go @@ -0,0 +1,362 @@ +/* +PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +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/postgresflex/wait/deprecation.go b/services/postgresflex/wait/deprecation.go new file mode 100644 index 000000000..58f184c09 --- /dev/null +++ b/services/postgresflex/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 From e53776f7d645fbd149fc7b98e455640b0fd5fde0 Mon Sep 17 00:00:00 2001 From: Ruben Hoenle Date: Thu, 5 Mar 2026 18:27:09 +0100 Subject: [PATCH 2/2] changelogs, waiters, examples --- CHANGELOG.md | 7 + examples/postgresflex/go.mod | 5 +- examples/postgresflex/go.sum | 6 +- examples/postgresflex/postgresflex.go | 20 +- examples/runtime/go.mod | 5 +- examples/runtime/go.sum | 6 +- examples/runtime/runtime.go | 10 +- services/postgresflex/CHANGELOG.md | 8 + services/postgresflex/VERSION | 2 +- services/postgresflex/v2api/wait/wait.go | 158 +++++++ services/postgresflex/v2api/wait/wait_test.go | 395 ++++++++++++++++++ services/postgresflex/wait/wait.go | 20 +- 12 files changed, 612 insertions(+), 30 deletions(-) create mode 100644 services/postgresflex/v2api/wait/wait.go create mode 100644 services/postgresflex/v2api/wait/wait_test.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 40f1779fb..080abca1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,13 @@ - `vpn`: [v0.1.0](services/vpn/CHANGELOG.md#v010) - **New:** SDK module for vpn service - `v1alpha1api`: New package which can be used for communication with the vpn v1 alpha1 API +- `postgresflex`: [v1.4.0](services/postgresflex/CHANGELOG.md#v140) + - **Feature:** Introduction of multi API version support for the postgresflex SDK module. For more details please see the announcement on GitHub: https://github.com/stackitcloud/stackit-sdk-go/discussions/5062 + - `v1api`: New package which can be used for communication with the postgresflex v1 API + - `v2api`: New package which can be used for communication with the postgresflex v1 API + - `v3alpha1api`: New package which can be used for communication with the postgresflex v3 alpha1 API + - **Deprecation:** The contents in the root of this SDK module including the `wait` package are marked as deprecated and will be removed after 2026-09-30. Switch to the new packages for the available API versions instead. + - **Dependencies:** Bump STACKIT SDK core module from `v0.21.1` to `v0.22.0` ## Release (2026-02-20) - `core`: [v0.21.1](core/CHANGELOG.md#v0211) diff --git a/examples/postgresflex/go.mod b/examples/postgresflex/go.mod index 9d2ad2451..fcc9be9cc 100644 --- a/examples/postgresflex/go.mod +++ b/examples/postgresflex/go.mod @@ -2,10 +2,13 @@ module github.com/stackitcloud/stackit-sdk-go/examples/postgresflex go 1.21 +// This is not needed in production. This is only here to point the golangci linter to the local version instead of the last release on GitHub. +replace github.com/stackitcloud/stackit-sdk-go/services/postgresflex => ../../services/postgresflex + require github.com/stackitcloud/stackit-sdk-go/services/postgresflex v1.3.5 require ( github.com/golang-jwt/jwt/v5 v5.3.1 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/stackitcloud/stackit-sdk-go/core v0.21.1 // indirect + github.com/stackitcloud/stackit-sdk-go/core v0.22.0 // indirect ) diff --git a/examples/postgresflex/go.sum b/examples/postgresflex/go.sum index 84b469d03..195011dd5 100644 --- a/examples/postgresflex/go.sum +++ b/examples/postgresflex/go.sum @@ -4,7 +4,5 @@ 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/postgresflex v1.3.5 h1:H67e3KnHQx954yI8fuQmxXwRf/myqAdLg2KvxImp00g= -github.com/stackitcloud/stackit-sdk-go/services/postgresflex v1.3.5/go.mod h1:xmAWk9eom8wznvLuLfm0F4xyeiBX8LaggXsKFmos+dw= +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= diff --git a/examples/postgresflex/postgresflex.go b/examples/postgresflex/postgresflex.go index 9a0e67d85..916295a2f 100644 --- a/examples/postgresflex/postgresflex.go +++ b/examples/postgresflex/postgresflex.go @@ -5,8 +5,8 @@ import ( "fmt" "os" - "github.com/stackitcloud/stackit-sdk-go/services/postgresflex" - "github.com/stackitcloud/stackit-sdk-go/services/postgresflex/wait" + postgresflex "github.com/stackitcloud/stackit-sdk-go/services/postgresflex/v2api" + "github.com/stackitcloud/stackit-sdk-go/services/postgresflex/v2api/wait" ) func main() { @@ -23,12 +23,12 @@ func main() { } // Get the postgresql instances for your project - getInstancesResp, err := postgresflexClient.ListInstances(context.Background(), projectId, region).Execute() + getInstancesResp, err := postgresflexClient.DefaultAPI.ListInstances(context.Background(), projectId, region).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ListInstances`: %v\n", err) os.Exit(1) } - items := *getInstancesResp.Items + items := getInstancesResp.Items fmt.Printf("Number of instances: %v\n", len(items)) // Create a user associated to an instance @@ -41,9 +41,9 @@ func main() { username := "example-user" createUserPayload := postgresflex.CreateUserPayload{ Username: &username, - Roles: &[]string{"login"}, + Roles: []string{"login"}, } - _, err = postgresflexClient.CreateUser(context.Background(), projectId, region, instanceId).CreateUserPayload(createUserPayload).Execute() + _, err = postgresflexClient.DefaultAPI.CreateUser(context.Background(), projectId, region, instanceId).CreateUserPayload(createUserPayload).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `CreateUser`: %v\n", err) os.Exit(1) @@ -52,13 +52,13 @@ func main() { fmt.Printf("Created user \"%s\" associated to instance \"%s\".\n", username, *items[0].Name) // Delete an instance - err = postgresflexClient.DeleteInstance(context.Background(), projectId, region, instanceId).Execute() + err = postgresflexClient.DefaultAPI.DeleteInstance(context.Background(), projectId, region, instanceId).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when delete PostgreSQL Flex instance: %v", err) } - _, err = wait.DeleteInstanceWaitHandler(context.Background(), postgresflexClient, projectId, region, instanceId).WaitWithContext(context.Background()) + _, err = wait.DeleteInstanceWaitHandler(context.Background(), postgresflexClient.DefaultAPI, projectId, region, instanceId).WaitWithContext(context.Background()) if err != nil { fmt.Fprintf(os.Stderr, "Error when waiting for PostgreSQL Flex instance deletion: %v", err) } @@ -66,13 +66,13 @@ func main() { fmt.Printf("Deleted PostgreSQL Flex instance \"%s\".\n", instanceId) // Force delete an instance - err = postgresflexClient.ForceDeleteInstance(context.Background(), projectId, region, instanceId).Execute() + err = postgresflexClient.DefaultAPI.ForceDeleteInstance(context.Background(), projectId, region, instanceId).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when force delete PostgreSQL Flex instance: %v", err) } - _, err = wait.ForceDeleteInstanceWaitHandler(context.Background(), postgresflexClient, projectId, region, instanceId).WaitWithContext(context.Background()) + _, err = wait.ForceDeleteInstanceWaitHandler(context.Background(), postgresflexClient.DefaultAPI, projectId, region, instanceId).WaitWithContext(context.Background()) if err != nil { fmt.Fprintf(os.Stderr, "Error when waiting for PostgreSQL Flex instance force deletion: %v", err) } diff --git a/examples/runtime/go.mod b/examples/runtime/go.mod index 43e0cb00a..4b6949af6 100644 --- a/examples/runtime/go.mod +++ b/examples/runtime/go.mod @@ -2,8 +2,11 @@ module github.com/stackitcloud/stackit-sdk-go/examples/runtime go 1.21 +// This is not needed in production. This is only here to point the golangci linter to the local version instead of the last release on GitHub. +replace github.com/stackitcloud/stackit-sdk-go/services/postgresflex => ../../services/postgresflex + require ( - github.com/stackitcloud/stackit-sdk-go/core v0.21.1 + github.com/stackitcloud/stackit-sdk-go/core v0.22.0 github.com/stackitcloud/stackit-sdk-go/services/postgresflex v1.3.5 ) diff --git a/examples/runtime/go.sum b/examples/runtime/go.sum index 84b469d03..195011dd5 100644 --- a/examples/runtime/go.sum +++ b/examples/runtime/go.sum @@ -4,7 +4,5 @@ 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/postgresflex v1.3.5 h1:H67e3KnHQx954yI8fuQmxXwRf/myqAdLg2KvxImp00g= -github.com/stackitcloud/stackit-sdk-go/services/postgresflex v1.3.5/go.mod h1:xmAWk9eom8wznvLuLfm0F4xyeiBX8LaggXsKFmos+dw= +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= diff --git a/examples/runtime/runtime.go b/examples/runtime/runtime.go index 38880c809..2a67e9f44 100644 --- a/examples/runtime/runtime.go +++ b/examples/runtime/runtime.go @@ -7,7 +7,7 @@ import ( "os" "github.com/stackitcloud/stackit-sdk-go/core/runtime" - "github.com/stackitcloud/stackit-sdk-go/services/postgresflex" + postgresflex "github.com/stackitcloud/stackit-sdk-go/services/postgresflex/v2api" ) func main() { @@ -26,22 +26,22 @@ func main() { // Get the PostgreSQL Flex instances for your project and capture the HTTP response using the context var httpResp *http.Response ctxWithHTTPResp := runtime.WithCaptureHTTPResponse(context.Background(), &httpResp) - getInstancesResp, err := postgresflexClient.ListInstances(ctxWithHTTPResp, projectId, region).Execute() + getInstancesResp, err := postgresflexClient.DefaultAPI.ListInstances(ctxWithHTTPResp, projectId, region).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ListInstances`: %v\n", err) os.Exit(1) } - fmt.Printf("Number of instances: %v\n\n", len(*getInstancesResp.Items)) + fmt.Printf("Number of instances: %v\n\n", len(getInstancesResp.Items)) fmt.Printf("HTTP response: %+v\n\n", *httpResp) // Get the PostgreSQL Flex instances for your project and capture the HTTP request using the context var httpReq *http.Request ctxWithHTTPReq := runtime.WithCaptureHTTPRequest(context.Background(), &httpReq) - getInstancesResp, err = postgresflexClient.ListInstances(ctxWithHTTPReq, projectId, region).Execute() + getInstancesResp, err = postgresflexClient.DefaultAPI.ListInstances(ctxWithHTTPReq, projectId, region).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ListInstances`: %v\n", err) os.Exit(1) } - fmt.Printf("Number of instances: %v\n\n", len(*getInstancesResp.Items)) + fmt.Printf("Number of instances: %v\n\n", len(getInstancesResp.Items)) fmt.Printf("HTTP request: %+v\n\n", *httpReq) } diff --git a/services/postgresflex/CHANGELOG.md b/services/postgresflex/CHANGELOG.md index 6aca62201..f9f0a1e05 100644 --- a/services/postgresflex/CHANGELOG.md +++ b/services/postgresflex/CHANGELOG.md @@ -1,3 +1,11 @@ +## v1.4.0 +- **Feature:** Introduction of multi API version support for the postgresflex SDK module. For more details please see the announcement on GitHub: https://github.com/stackitcloud/stackit-sdk-go/discussions/5062 +- `v1api`: New package which can be used for communication with the postgresflex v1 API +- `v2api`: New package which can be used for communication with the postgresflex v1 API +- `v3alpha1api`: New package which can be used for communication with the postgresflex v3 alpha1 API +- **Deprecation:** The contents in the root of this SDK module including the `wait` package are marked as deprecated and will be removed after 2026-09-30. Switch to the new packages for the available API versions instead. +- **Dependencies:** Bump STACKIT SDK core module from `v0.21.1` to `v0.22.0` + ## v1.3.5 - Bump STACKIT SDK core module from `v0.21.0` to `v0.21.1` diff --git a/services/postgresflex/VERSION b/services/postgresflex/VERSION index a3a007cb3..0d0c52f84 100644 --- a/services/postgresflex/VERSION +++ b/services/postgresflex/VERSION @@ -1 +1 @@ -v1.3.5 \ No newline at end of file +v1.4.0 diff --git a/services/postgresflex/v2api/wait/wait.go b/services/postgresflex/v2api/wait/wait.go new file mode 100644 index 000000000..2b1d9ca87 --- /dev/null +++ b/services/postgresflex/v2api/wait/wait.go @@ -0,0 +1,158 @@ +package wait + +import ( + "context" + "fmt" + "time" + + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/wait" + postgresflex "github.com/stackitcloud/stackit-sdk-go/services/postgresflex/v2api" +) + +const ( + InstanceStateEmpty = "" + InstanceStateProgressing = "Progressing" + InstanceStateSuccess = "Ready" + InstanceStateFailed = "Failure" + InstanceStateDeleted = "Deleted" +) + +// CreateInstanceWaitHandler will wait for instance creation +func CreateInstanceWaitHandler(ctx context.Context, a postgresflex.DefaultAPI, projectId, region, instanceId string) *wait.AsyncActionHandler[postgresflex.InstanceResponse] { + instanceCreated := false + var instanceGetResponse *postgresflex.InstanceResponse + + handler := wait.New(func() (waitFinished bool, response *postgresflex.InstanceResponse, err error) { + if !instanceCreated { + s, err := a.GetInstance(ctx, projectId, region, instanceId).Execute() + if err != nil { + return false, nil, err + } + if s == nil || s.Item == nil || s.Item.Id == nil || *s.Item.Id != instanceId || s.Item.Status == nil { + return false, nil, nil + } + switch *s.Item.Status { + default: + return true, s, fmt.Errorf("instance with id %s has unexpected status %s", instanceId, *s.Item.Status) + case InstanceStateEmpty: + return false, nil, nil + case InstanceStateProgressing: + return false, nil, nil + case InstanceStateSuccess: + instanceCreated = true + instanceGetResponse = s + case InstanceStateFailed: + return true, s, fmt.Errorf("create failed for instance with id %s", instanceId) + } + } + + // User operations aren't available right after an instance is deemed successful + // To check if they are, perform a users request + _, err = a.ListUsers(ctx, projectId, region, instanceId).Execute() + if err == nil { + return true, instanceGetResponse, nil + } + oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped + if !ok { + return false, nil, err + } + if oapiErr.StatusCode < 500 { + return true, instanceGetResponse, fmt.Errorf("users request after instance creation returned %d status code", oapiErr.StatusCode) + } + return false, nil, nil + }) + // Sleep before wait is set because sometimes API returns 404 right after creation request + handler.SetTimeout(45 * time.Minute).SetSleepBeforeWait(15 * time.Second) + return handler +} + +// PartialUpdateInstanceWaitHandler will wait for instance update +func PartialUpdateInstanceWaitHandler(ctx context.Context, a postgresflex.DefaultAPI, projectId, region, instanceId string) *wait.AsyncActionHandler[postgresflex.InstanceResponse] { + handler := wait.New(func() (waitFinished bool, response *postgresflex.InstanceResponse, err error) { + s, err := a.GetInstance(ctx, projectId, region, instanceId).Execute() + if err != nil { + return false, nil, err + } + if s == nil || s.Item == nil || s.Item.Id == nil || *s.Item.Id != instanceId || s.Item.Status == nil { + return false, nil, nil + } + switch *s.Item.Status { + default: + return true, s, fmt.Errorf("instance with id %s has unexpected status %s", instanceId, *s.Item.Status) + case InstanceStateEmpty: + return false, nil, nil + case InstanceStateProgressing: + return false, nil, nil + case InstanceStateSuccess: + return true, s, nil + case InstanceStateFailed: + return true, s, fmt.Errorf("update failed for instance with id %s", instanceId) + } + }) + handler.SetTimeout(45 * time.Minute) + return handler +} + +// DeleteInstanceWaitHandler will wait for instance deletion +func DeleteInstanceWaitHandler(ctx context.Context, a postgresflex.DefaultAPI, projectId, region, instanceId string) *wait.AsyncActionHandler[struct{}] { + handler := wait.New(func() (waitFinished bool, response *struct{}, err error) { + s, err := a.GetInstance(ctx, projectId, region, instanceId).Execute() + if err != nil { + return false, nil, err + } + if s == nil || s.Item == nil || s.Item.Id == nil || *s.Item.Id != instanceId || s.Item.Status == nil { + return false, nil, nil + } + switch *s.Item.Status { + default: + return true, nil, fmt.Errorf("instance with id %s has unexpected status %s", instanceId, *s.Item.Status) + case InstanceStateSuccess: + return false, nil, nil + case InstanceStateDeleted: + return true, nil, nil + } + }) + handler.SetTimeout(5 * time.Minute) + return handler +} + +// ForceDeleteInstanceWaitHandler will wait for instance deletion +func ForceDeleteInstanceWaitHandler(ctx context.Context, a postgresflex.DefaultAPI, projectId, region, instanceId string) *wait.AsyncActionHandler[struct{}] { + handler := wait.New(func() (waitFinished bool, response *struct{}, err error) { + _, err = a.GetInstance(ctx, projectId, region, instanceId).Execute() + if err == nil { + return false, nil, nil + } + oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped + if !ok { + return false, nil, err + } + if oapiErr.StatusCode != 404 { + return false, nil, err + } + return true, nil, nil + }) + handler.SetTimeout(15 * time.Minute) + return handler +} + +// DeleteUserWaitHandler will wait for delete +func DeleteUserWaitHandler(ctx context.Context, a postgresflex.DefaultAPI, projectId, region, instanceId, userId string) *wait.AsyncActionHandler[struct{}] { + handler := wait.New(func() (waitFinished bool, response *struct{}, err error) { + _, err = a.GetUser(ctx, projectId, region, instanceId, userId).Execute() + if err == nil { + return false, nil, nil + } + oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped + if !ok { + return false, nil, err + } + if oapiErr.StatusCode != 404 { + return false, nil, err + } + return true, nil, nil + }) + handler.SetTimeout(1 * time.Minute) + return handler +} diff --git a/services/postgresflex/v2api/wait/wait_test.go b/services/postgresflex/v2api/wait/wait_test.go new file mode 100644 index 000000000..814e7a5b0 --- /dev/null +++ b/services/postgresflex/v2api/wait/wait_test.go @@ -0,0 +1,395 @@ +package wait + +import ( + "context" + "testing" + "time" + + "github.com/google/go-cmp/cmp" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/utils" + postgresflex "github.com/stackitcloud/stackit-sdk-go/services/postgresflex/v2api" +) + +type mockSettings struct { + instanceId string + instanceState string + instanceIsForceDeleted bool + instanceGetFails bool + + usersGetErrorStatus int + + userGetFails bool + userId string + userIsDeleted bool +} + +// Used for testing instance operations +func newAPIMock(settings *mockSettings) postgresflex.DefaultAPI { + return &postgresflex.DefaultAPIServiceMock{ + GetInstanceExecuteMock: utils.Ptr(func(_ postgresflex.ApiGetInstanceRequest) (*postgresflex.InstanceResponse, error) { + if settings.instanceGetFails { + return nil, &oapierror.GenericOpenAPIError{ + StatusCode: 500, + } + } + + if settings.instanceIsForceDeleted { + return nil, &oapierror.GenericOpenAPIError{ + StatusCode: 404, + } + } + + return &postgresflex.InstanceResponse{ + Item: &postgresflex.Instance{ + Id: &settings.instanceId, + Status: &settings.instanceState, + }, + }, nil + }), + ListUsersExecuteMock: utils.Ptr(func(_ postgresflex.ApiListUsersRequest) (*postgresflex.ListUsersResponse, error) { + if settings.usersGetErrorStatus != 0 { + return nil, &oapierror.GenericOpenAPIError{ + StatusCode: settings.usersGetErrorStatus, + } + } + + aux := int64(0) + return &postgresflex.ListUsersResponse{ + Count: &aux, + Items: []postgresflex.ListUsersResponseItem{}, + }, nil + }), + GetUserExecuteMock: utils.Ptr(func(_ postgresflex.ApiGetUserRequest) (*postgresflex.GetUserResponse, error) { + if settings.userGetFails { + return nil, &oapierror.GenericOpenAPIError{ + StatusCode: 500, + } + } + + if settings.userIsDeleted { + return nil, &oapierror.GenericOpenAPIError{ + StatusCode: 404, + } + } + + return &postgresflex.GetUserResponse{ + Item: &postgresflex.UserResponse{ + Id: &settings.userId, + }, + }, nil + }), + } +} + +func TestCreateInstanceWaitHandler(t *testing.T) { + tests := []struct { + desc string + instanceGetFails bool + instanceState string + usersGetErrorStatus int + wantErr bool + wantResp bool + }{ + { + desc: "create_succeeded", + instanceGetFails: false, + instanceState: InstanceStateSuccess, + wantErr: false, + wantResp: true, + }, + { + desc: "create_failed", + instanceGetFails: false, + instanceState: InstanceStateFailed, + wantErr: true, + wantResp: true, + }, + { + desc: "create_failed_2", + instanceGetFails: false, + instanceState: InstanceStateEmpty, + wantErr: true, + wantResp: false, + }, + { + desc: "instance_get_fails", + instanceGetFails: true, + wantErr: true, + wantResp: false, + }, + { + desc: "users_get_fails", + instanceGetFails: false, + instanceState: InstanceStateSuccess, + usersGetErrorStatus: 500, + wantErr: true, + wantResp: false, + }, + { + desc: "users_get_fails_2", + instanceGetFails: false, + instanceState: InstanceStateSuccess, + usersGetErrorStatus: 400, + wantErr: true, + wantResp: true, + }, + { + desc: "timeout", + instanceGetFails: false, + instanceState: InstanceStateProgressing, + wantErr: true, + wantResp: false, + }, + } + for _, tt := range tests { + t.Run(tt.desc, func(t *testing.T) { + instanceId := "foo-bar" + + apiClient := newAPIMock(&mockSettings{ + instanceId: instanceId, + instanceState: tt.instanceState, + instanceGetFails: tt.instanceGetFails, + usersGetErrorStatus: tt.usersGetErrorStatus, + }) + + var wantRes *postgresflex.InstanceResponse + if tt.wantResp { + wantRes = &postgresflex.InstanceResponse{ + Item: &postgresflex.Instance{ + Id: &instanceId, + Status: utils.Ptr(tt.instanceState), + }, + } + } + + handler := CreateInstanceWaitHandler(context.Background(), apiClient, "", "", instanceId) + + gotRes, err := handler.SetTimeout(10 * time.Millisecond).SetSleepBeforeWait(1 * time.Millisecond).WaitWithContext(context.Background()) + + if (err != nil) != tt.wantErr { + t.Fatalf("handler error = %v, wantErr %v", err, tt.wantErr) + } + if !cmp.Equal(gotRes, wantRes) { + t.Fatalf("handler gotRes = %v, want %v", gotRes, wantRes) + } + }) + } +} + +func TestUpdateInstanceWaitHandler(t *testing.T) { + tests := []struct { + desc string + instanceGetFails bool + instanceState string + wantErr bool + wantResp bool + }{ + { + desc: "update_succeeded", + instanceGetFails: false, + instanceState: InstanceStateSuccess, + wantErr: false, + wantResp: true, + }, + { + desc: "update_failed", + instanceGetFails: false, + instanceState: InstanceStateFailed, + wantErr: true, + wantResp: true, + }, + { + desc: "update_failed_2", + instanceGetFails: false, + instanceState: InstanceStateEmpty, + wantErr: true, + wantResp: false, + }, + { + desc: "get_fails", + instanceGetFails: true, + wantErr: true, + wantResp: false, + }, + { + desc: "timeout", + instanceGetFails: false, + instanceState: InstanceStateProgressing, + wantErr: true, + wantResp: false, + }, + } + for _, tt := range tests { + t.Run(tt.desc, func(t *testing.T) { + instanceId := "foo-bar" + + apiClient := newAPIMock(&mockSettings{ + instanceId: instanceId, + instanceState: tt.instanceState, + instanceGetFails: tt.instanceGetFails, + }) + + var wantRes *postgresflex.InstanceResponse + if tt.wantResp { + wantRes = &postgresflex.InstanceResponse{ + Item: &postgresflex.Instance{ + Id: &instanceId, + Status: utils.Ptr(tt.instanceState), + }, + } + } + + handler := PartialUpdateInstanceWaitHandler(context.Background(), apiClient, "", "", instanceId) + + gotRes, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) + + if (err != nil) != tt.wantErr { + t.Fatalf("handler error = %v, wantErr %v", err, tt.wantErr) + } + if !cmp.Equal(gotRes, wantRes) { + t.Fatalf("handler gotRes = %v, want %v", gotRes, wantRes) + } + }) + } +} + +func TestDeleteInstanceWaitHandler(t *testing.T) { + tests := []struct { + desc string + instanceGetFails bool + instanceState string + wantErr bool + }{ + { + desc: "delete_succeeded", + instanceGetFails: false, + instanceState: InstanceStateDeleted, + wantErr: false, + }, + { + desc: "delete_failed", + instanceGetFails: false, + instanceState: InstanceStateFailed, + wantErr: true, + }, + { + desc: "get_fails", + instanceGetFails: true, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.desc, func(t *testing.T) { + instanceId := "foo-bar" + + apiClient := newAPIMock(&mockSettings{ + instanceGetFails: tt.instanceGetFails, + instanceId: instanceId, + instanceState: tt.instanceState, + }) + + handler := DeleteInstanceWaitHandler(context.Background(), apiClient, "", "", instanceId) + + _, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) + + if (err != nil) != tt.wantErr { + t.Fatalf("handler error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestForceDeleteInstanceWaitHandler(t *testing.T) { + tests := []struct { + desc string + instanceGetFails bool + instanceState string + wantErr bool + }{ + { + desc: "delete_succeeded", + instanceGetFails: false, + instanceState: InstanceStateDeleted, + wantErr: false, + }, + { + desc: "delete_failed", + instanceGetFails: false, + instanceState: InstanceStateFailed, + wantErr: true, + }, + { + desc: "get_fails", + instanceGetFails: true, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.desc, func(t *testing.T) { + instanceId := "foo-bar" + + apiClient := newAPIMock(&mockSettings{ + instanceGetFails: tt.instanceGetFails, + instanceIsForceDeleted: tt.instanceState == InstanceStateDeleted, + instanceId: instanceId, + instanceState: tt.instanceState, + }) + + handler := ForceDeleteInstanceWaitHandler(context.Background(), apiClient, "", "", instanceId) + + _, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) + + if (err != nil) != tt.wantErr { + t.Fatalf("handler error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestDeleteUserWaitHandler(t *testing.T) { + tests := []struct { + desc string + deleteFails bool + getFails bool + wantErr bool + }{ + { + desc: "delete_succeeded", + deleteFails: false, + getFails: false, + wantErr: false, + }, + { + desc: "delete_failed", + deleteFails: true, + getFails: false, + wantErr: true, + }, + { + desc: "get_fails", + deleteFails: false, + getFails: true, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.desc, func(t *testing.T) { + userId := "foo-bar" + + apiClient := newAPIMock(&mockSettings{ + userGetFails: tt.getFails, + userId: userId, + userIsDeleted: !tt.deleteFails, + }) + + handler := DeleteUserWaitHandler(context.Background(), apiClient, "", "", "", userId) + + _, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) + + if (err != nil) != tt.wantErr { + t.Fatalf("handler error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} diff --git a/services/postgresflex/wait/wait.go b/services/postgresflex/wait/wait.go index 2abf1af74..e8b1a19f1 100644 --- a/services/postgresflex/wait/wait.go +++ b/services/postgresflex/wait/wait.go @@ -11,25 +11,33 @@ import ( ) const ( - InstanceStateEmpty = "" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + InstanceStateEmpty = "" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead InstanceStateProgressing = "Progressing" - InstanceStateSuccess = "Ready" - InstanceStateFailed = "Failure" - InstanceStateDeleted = "Deleted" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + InstanceStateSuccess = "Ready" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + InstanceStateFailed = "Failure" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + InstanceStateDeleted = "Deleted" ) // Interface needed for tests +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type APIClientInstanceInterface interface { GetInstanceExecute(ctx context.Context, projectId, region, instanceId string) (*postgresflex.InstanceResponse, error) ListUsersExecute(ctx context.Context, projectId, region, instanceId string) (*postgresflex.ListUsersResponse, error) } // Interface needed for tests +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type APIClientUserInterface interface { GetUserExecute(ctx context.Context, projectId, region, instanceId, userId string) (*postgresflex.GetUserResponse, error) } // CreateInstanceWaitHandler will wait for instance creation +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func CreateInstanceWaitHandler(ctx context.Context, a APIClientInstanceInterface, projectId, region, instanceId string) *wait.AsyncActionHandler[postgresflex.InstanceResponse] { instanceCreated := false var instanceGetResponse *postgresflex.InstanceResponse @@ -79,6 +87,7 @@ func CreateInstanceWaitHandler(ctx context.Context, a APIClientInstanceInterface } // PartialUpdateInstanceWaitHandler will wait for instance update +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PartialUpdateInstanceWaitHandler(ctx context.Context, a APIClientInstanceInterface, projectId, region, instanceId string) *wait.AsyncActionHandler[postgresflex.InstanceResponse] { handler := wait.New(func() (waitFinished bool, response *postgresflex.InstanceResponse, err error) { s, err := a.GetInstanceExecute(ctx, projectId, region, instanceId) @@ -106,6 +115,7 @@ func PartialUpdateInstanceWaitHandler(ctx context.Context, a APIClientInstanceIn } // DeleteInstanceWaitHandler will wait for instance deletion +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func DeleteInstanceWaitHandler(ctx context.Context, a APIClientInstanceInterface, projectId, region, instanceId string) *wait.AsyncActionHandler[struct{}] { handler := wait.New(func() (waitFinished bool, response *struct{}, err error) { s, err := a.GetInstanceExecute(ctx, projectId, region, instanceId) @@ -129,6 +139,7 @@ func DeleteInstanceWaitHandler(ctx context.Context, a APIClientInstanceInterface } // ForceDeleteInstanceWaitHandler will wait for instance deletion +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func ForceDeleteInstanceWaitHandler(ctx context.Context, a APIClientInstanceInterface, projectId, region, instanceId string) *wait.AsyncActionHandler[struct{}] { handler := wait.New(func() (waitFinished bool, response *struct{}, err error) { _, err = a.GetInstanceExecute(ctx, projectId, region, instanceId) @@ -149,6 +160,7 @@ func ForceDeleteInstanceWaitHandler(ctx context.Context, a APIClientInstanceInte } // DeleteUserWaitHandler will wait for delete +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func DeleteUserWaitHandler(ctx context.Context, a APIClientUserInterface, projectId, region, instanceId, userId string) *wait.AsyncActionHandler[struct{}] { handler := wait.New(func() (waitFinished bool, response *struct{}, err error) { _, err = a.GetUserExecute(ctx, projectId, region, instanceId, userId)