From aefd83cb2c58affbd4d58536c39298fd5269064d Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Wed, 4 Mar 2026 10:58:58 +0000 Subject: [PATCH] Generate sqlserverflex --- services/sqlserverflex/api_default.go | 320 +- services/sqlserverflex/client.go | 7 + services/sqlserverflex/configuration.go | 2 + services/sqlserverflex/go.mod | 2 +- services/sqlserverflex/go.sum | 4 +- services/sqlserverflex/model_acl.go | 24 + services/sqlserverflex/model_backup.go | 96 + ...el_backup_list_backups_response_grouped.go | 34 + .../model_create_database_payload.go | 33 + .../model_create_database_response.go | 23 + .../model_create_instance_payload.go | 96 + .../model_create_instance_payload_acl.go | 24 + .../model_create_instance_payload_options.go | 33 + .../model_create_instance_payload_storage.go | 34 + .../model_create_instance_response.go | 23 + .../model_create_user_payload.go | 43 + .../model_create_user_response.go | 24 + services/sqlserverflex/model_data_point.go | 34 + services/sqlserverflex/model_database.go | 44 + ...ntation_create_database_request_options.go | 43 + .../sqlserverflex/model_database_options.go | 44 + services/sqlserverflex/model_flavor.go | 55 + .../model_get_backup_response.go | 96 + .../model_get_database_response.go | 24 + .../model_get_instance_response.go | 24 + .../sqlserverflex/model_get_user_response.go | 24 + services/sqlserverflex/model_host.go | 34 + services/sqlserverflex/model_host_metric.go | 44 + services/sqlserverflex/model_instance.go | 118 + .../model_instance_documentation_acl.go | 24 + .../model_instance_documentation_options.go | 33 + .../model_instance_documentation_storage.go | 34 + .../sqlserverflex/model_instance_error.go | 56 + .../model_instance_flavor_entry.go | 65 + .../model_instance_list_instance.go | 43 + .../sqlserverflex/model_instance_list_user.go | 33 + .../model_list_backups_response.go | 24 + .../model_list_collations_response.go | 24 + .../model_list_compatibility_response.go | 24 + .../model_list_databases_response.go | 24 + .../model_list_flavors_response.go | 24 + .../model_list_instances_response.go | 35 + .../model_list_metrics_response.go | 24 + .../model_list_restore_jobs_response.go | 24 + .../model_list_roles_response.go | 24 + .../model_list_storages_response.go | 35 + .../model_list_users_response.go | 35 + .../model_list_versions_response.go | 24 + .../model_mssql_database_collation.go | 33 + .../model_mssql_database_compatibility.go | 34 + .../model_partial_update_instance_payload.go | 75 + .../model_reset_user_response.go | 24 + .../model_restore_running_restore.go | 64 + .../sqlserverflex/model_single_database.go | 44 + .../model_single_database_options.go | 44 + services/sqlserverflex/model_single_user.go | 95 + services/sqlserverflex/model_storage.go | 34 + services/sqlserverflex/model_storage_range.go | 35 + .../model_trigger_database_restore_payload.go | 32 + services/sqlserverflex/model_type.go | 31 +- .../model_update_instance_payload.go | 70 + .../model_update_instance_response.go | 24 + services/sqlserverflex/model_user.go | 95 + .../sqlserverflex/model_user_response_user.go | 75 + services/sqlserverflex/oas_commit | 2 +- services/sqlserverflex/utils.go | 81 + services/sqlserverflex/v1api/api_default.go | 4247 ++++++++++++ .../sqlserverflex/v1api/api_default_mock.go | 592 ++ services/sqlserverflex/v1api/client.go | 659 ++ services/sqlserverflex/v1api/configuration.go | 41 + services/sqlserverflex/v1api/model_acl.go | 125 + services/sqlserverflex/v1api/model_backup.go | 377 + ...el_backup_list_backups_response_grouped.go | 161 + .../v1api/model_create_database_payload.go | 185 + .../v1api/model_create_database_response.go | 125 + .../v1api/model_create_instance_payload.go | 413 ++ .../v1api/model_create_instance_response.go | 125 + .../v1api/model_create_user_payload.go | 221 + .../v1api/model_create_user_response.go | 125 + .../sqlserverflex/v1api/model_data_point.go | 161 + .../sqlserverflex/v1api/model_database.go | 198 + ...ntation_create_database_request_options.go | 232 + .../v1api/model_database_options.go | 200 + services/sqlserverflex/v1api/model_flavor.go | 233 + .../v1api/model_get_backup_response.go | 385 ++ .../v1api/model_get_database_response.go | 125 + .../v1api/model_get_instance_response.go | 125 + .../v1api/model_get_user_response.go | 125 + services/sqlserverflex/v1api/model_host.go | 161 + .../sqlserverflex/v1api/model_host_metric.go | 197 + .../sqlserverflex/v1api/model_instance.go | 449 ++ .../v1api/model_instance_documentation_acl.go | 126 + .../model_instance_documentation_options.go | 171 + .../model_instance_documentation_storage.go | 167 + .../v1api/model_instance_error.go | 233 + .../v1api/model_instance_flavor_entry.go | 269 + .../v1api/model_instance_list_instance.go | 197 + .../v1api/model_instance_list_user.go | 161 + .../v1api/model_list_backups_response.go | 125 + .../v1api/model_list_collations_response.go | 125 + .../model_list_compatibility_response.go | 125 + .../v1api/model_list_databases_response.go | 125 + .../v1api/model_list_flavors_response.go | 125 + .../v1api/model_list_instances_response.go | 161 + .../v1api/model_list_metrics_response.go | 125 + .../v1api/model_list_restore_jobs_response.go | 125 + .../v1api/model_list_roles_response.go | 125 + .../v1api/model_list_storages_response.go | 161 + .../v1api/model_list_users_response.go | 161 + .../v1api/model_list_versions_response.go | 125 + .../v1api/model_mssql_database_collation.go | 161 + .../model_mssql_database_compatibility.go | 161 + .../model_partial_update_instance_payload.go | 315 + .../v1api/model_reset_user_response.go | 125 + .../v1api/model_restore_running_restore.go | 269 + .../v1api/model_single_database.go | 200 + .../sqlserverflex/v1api/model_single_user.go | 377 + services/sqlserverflex/v1api/model_storage.go | 161 + .../v1api/model_storage_range.go | 161 + .../model_trigger_database_restore_payload.go | 187 + services/sqlserverflex/v1api/model_type.go | 119 + .../v1api/model_update_instance_payload.go | 305 + .../v1api/model_update_instance_response.go | 125 + services/sqlserverflex/v1api/model_user.go | 377 + .../v1api/model_user_response_user.go | 305 + services/sqlserverflex/v1api/response.go | 48 + services/sqlserverflex/v1api/utils.go | 362 + services/sqlserverflex/v2api/api_default.go | 4850 +++++++++++++ .../sqlserverflex/v2api/api_default_mock.go | 639 ++ services/sqlserverflex/v2api/client.go | 659 ++ services/sqlserverflex/v2api/configuration.go | 38 + services/sqlserverflex/v2api/model_acl.go | 125 + services/sqlserverflex/v2api/model_backup.go | 377 + ...el_backup_list_backups_response_grouped.go | 161 + .../v2api/model_create_database_payload.go | 185 + .../v2api/model_create_database_response.go | 125 + .../v2api/model_create_instance_payload.go | 413 ++ .../v2api/model_create_instance_response.go | 125 + .../v2api/model_create_user_payload.go | 221 + .../v2api/model_create_user_response.go | 125 + .../sqlserverflex/v2api/model_data_point.go | 161 + .../sqlserverflex/v2api/model_database.go | 198 + ...ntation_create_database_request_options.go | 232 + .../v2api/model_database_options.go | 200 + services/sqlserverflex/v2api/model_flavor.go | 233 + .../v2api/model_get_backup_response.go | 385 ++ .../v2api/model_get_database_response.go | 125 + .../v2api/model_get_instance_response.go | 125 + .../v2api/model_get_user_response.go | 125 + services/sqlserverflex/v2api/model_host.go | 161 + .../sqlserverflex/v2api/model_host_metric.go | 197 + .../sqlserverflex/v2api/model_instance.go | 449 ++ .../v2api/model_instance_documentation_acl.go | 126 + .../model_instance_documentation_options.go | 171 + .../model_instance_documentation_storage.go | 167 + .../v2api/model_instance_error.go | 233 + .../v2api/model_instance_flavor_entry.go | 269 + .../v2api/model_instance_list_instance.go | 197 + .../v2api/model_instance_list_user.go | 161 + .../v2api/model_list_backups_response.go | 125 + .../v2api/model_list_collations_response.go | 125 + .../model_list_compatibility_response.go | 125 + .../v2api/model_list_databases_response.go | 125 + .../v2api/model_list_flavors_response.go | 125 + .../v2api/model_list_instances_response.go | 161 + .../v2api/model_list_metrics_response.go | 125 + .../v2api/model_list_restore_jobs_response.go | 125 + .../v2api/model_list_roles_response.go | 125 + .../v2api/model_list_storages_response.go | 161 + .../v2api/model_list_users_response.go | 161 + .../v2api/model_list_versions_response.go | 125 + .../v2api/model_mssql_database_collation.go | 161 + .../model_mssql_database_compatibility.go | 161 + .../model_partial_update_instance_payload.go | 315 + .../v2api/model_reset_user_response.go | 125 + .../v2api/model_restore_running_restore.go | 269 + .../v2api/model_single_database.go | 200 + .../sqlserverflex/v2api/model_single_user.go | 377 + services/sqlserverflex/v2api/model_storage.go | 161 + .../v2api/model_storage_range.go | 161 + .../model_trigger_database_restore_payload.go | 187 + services/sqlserverflex/v2api/model_type.go | 119 + .../v2api/model_update_instance_payload.go | 305 + .../v2api/model_update_instance_response.go | 125 + services/sqlserverflex/v2api/model_user.go | 377 + .../v2api/model_user_response_user.go | 305 + services/sqlserverflex/v2api/response.go | 48 + services/sqlserverflex/v2api/utils.go | 362 + .../sqlserverflex/v3alpha1api/api_default.go | 6083 +++++++++++++++++ .../v3alpha1api/api_default_mock.go | 637 ++ services/sqlserverflex/v3alpha1api/client.go | 659 ++ .../v3alpha1api/configuration.go | 41 + .../model_backup_running_restore.go | 274 + .../v3alpha1api/model_backup_sort.go | 131 + .../model_create_database_request_payload.go | 261 + .../model_create_database_response.go | 158 + .../model_create_instance_request_payload.go | 365 + ...create_instance_request_payload_network.go | 198 + .../model_create_instance_response.go | 158 + .../model_create_user_request_payload.go | 224 + .../v3alpha1api/model_create_user_response.go | 389 ++ .../model_database_getcollation.go | 161 + .../model_database_getcompatibility.go | 161 + .../v3alpha1api/model_database_roles.go | 187 + .../v3alpha1api/model_database_sort.go | 127 + .../sqlserverflex/v3alpha1api/model_error.go | 245 + .../v3alpha1api/model_external_s3.go | 245 + .../v3alpha1api/model_flavor_sort.go | 143 + ...el_flavor_storage_classes_storage_class.go | 213 + .../v3alpha1api/model_flavor_storage_range.go | 187 + .../v3alpha1api/model_get_backup_response.go | 303 + .../model_get_collations_response.go | 158 + .../model_get_database_response.go | 274 + .../v3alpha1api/model_get_flavors_response.go | 186 + .../model_get_instance_response.go | 507 ++ .../model_get_storages_response.go | 186 + .../v3alpha1api/model_get_user_response.go | 332 + .../model_get_versions_response.go | 158 + .../v3alpha1api/model_instance_edition.go | 113 + .../v3alpha1api/model_instance_encryption.go | 244 + .../v3alpha1api/model_instance_network.go | 238 + .../model_instance_network_access_scope.go | 111 + .../v3alpha1api/model_instance_sort.go | 127 + .../v3alpha1api/model_instance_version.go | 109 + .../v3alpha1api/model_instance_version_opt.go | 109 + .../v3alpha1api/model_list_backup.go | 303 + .../v3alpha1api/model_list_backup_response.go | 186 + .../model_list_backups_response.go | 187 + .../model_list_compatibility_response.go | 158 + ...model_list_current_running_restore_jobs.go | 158 + .../v3alpha1api/model_list_database.go | 245 + .../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 | 245 + ...el_restore_database_from_backup_payload.go | 186 + ...ore_database_from_backup_payload_source.go | 154 + .../v3alpha1api/model_s3file_info.go | 163 + .../v3alpha1api/model_source_backup.go | 157 + .../v3alpha1api/model_source_external_s3.go | 251 + .../sqlserverflex/v3alpha1api/model_status.go | 119 + .../v3alpha1api/model_storage.go | 163 + .../v3alpha1api/model_storage_create.go | 187 + .../v3alpha1api/model_storage_update.go | 126 + .../model_trigger_restore_request_payload.go | 187 + ...date_instance_partially_request_payload.go | 380 + ...tance_partially_request_payload_network.go | 126 + .../model_update_instance_request_payload.go | 357 + ...update_instance_request_payload_network.go | 158 + .../v3alpha1api/model_user_sort.go | 123 + .../v3alpha1api/model_validation_error.go | 187 + ...model_validation_error_validation_inner.go | 185 + .../v3alpha1api/model_version.go | 245 + .../sqlserverflex/v3alpha1api/response.go | 48 + services/sqlserverflex/v3alpha1api/utils.go | 362 + .../sqlserverflex/v3beta1api/api_default.go | 6083 +++++++++++++++++ .../v3beta1api/api_default_mock.go | 637 ++ services/sqlserverflex/v3beta1api/client.go | 659 ++ .../sqlserverflex/v3beta1api/configuration.go | 41 + .../model_backup_running_restore.go | 274 + .../v3beta1api/model_backup_sort.go | 131 + .../model_create_database_request_payload.go | 261 + .../model_create_database_response.go | 158 + .../model_create_instance_request_payload.go | 365 + ...create_instance_request_payload_network.go | 198 + .../model_create_instance_response.go | 158 + .../model_create_user_request_payload.go | 224 + .../v3beta1api/model_create_user_response.go | 389 ++ .../v3beta1api/model_database_getcollation.go | 161 + .../model_database_getcompatibility.go | 161 + .../v3beta1api/model_database_roles.go | 187 + .../v3beta1api/model_database_sort.go | 127 + .../sqlserverflex/v3beta1api/model_error.go | 245 + .../v3beta1api/model_external_s3.go | 245 + .../v3beta1api/model_flavor_sort.go | 143 + ...el_flavor_storage_classes_storage_class.go | 213 + .../v3beta1api/model_flavor_storage_range.go | 187 + .../v3beta1api/model_get_backup_response.go | 303 + .../model_get_collations_response.go | 158 + .../v3beta1api/model_get_database_response.go | 274 + .../v3beta1api/model_get_flavors_response.go | 186 + .../v3beta1api/model_get_instance_response.go | 507 ++ .../v3beta1api/model_get_storages_response.go | 186 + .../v3beta1api/model_get_user_response.go | 332 + .../v3beta1api/model_get_versions_response.go | 158 + .../v3beta1api/model_instance_edition.go | 113 + .../v3beta1api/model_instance_encryption.go | 244 + .../v3beta1api/model_instance_network.go | 238 + .../model_instance_network_access_scope.go | 111 + .../v3beta1api/model_instance_sort.go | 127 + .../v3beta1api/model_instance_version.go | 109 + .../v3beta1api/model_instance_version_opt.go | 109 + .../v3beta1api/model_list_backup.go | 303 + .../v3beta1api/model_list_backup_response.go | 186 + .../v3beta1api/model_list_backups_response.go | 187 + .../model_list_compatibility_response.go | 158 + ...model_list_current_running_restore_jobs.go | 158 + .../v3beta1api/model_list_database.go | 245 + .../model_list_databases_response.go | 186 + .../v3beta1api/model_list_flavors.go | 361 + .../v3beta1api/model_list_instance.go | 244 + .../model_list_instances_response.go | 186 + .../v3beta1api/model_list_roles_response.go | 158 + .../v3beta1api/model_list_user.go | 216 + .../v3beta1api/model_list_user_response.go | 186 + .../v3beta1api/model_pagination.go | 269 + .../model_protect_instance_request_payload.go | 158 + .../model_protect_instance_response.go | 158 + .../v3beta1api/model_replicas.go | 111 + .../v3beta1api/model_replicas_opt.go | 111 + .../v3beta1api/model_reset_user_response.go | 245 + ...el_restore_database_from_backup_payload.go | 186 + ...ore_database_from_backup_payload_source.go | 154 + .../v3beta1api/model_s3file_info.go | 163 + .../v3beta1api/model_source_backup.go | 157 + .../v3beta1api/model_source_external_s3.go | 251 + .../sqlserverflex/v3beta1api/model_status.go | 119 + .../sqlserverflex/v3beta1api/model_storage.go | 163 + .../v3beta1api/model_storage_create.go | 187 + .../v3beta1api/model_storage_update.go | 126 + .../model_trigger_restore_request_payload.go | 187 + ...date_instance_partially_request_payload.go | 380 + ...tance_partially_request_payload_network.go | 126 + .../model_update_instance_request_payload.go | 357 + ...update_instance_request_payload_network.go | 158 + .../v3beta1api/model_user_sort.go | 123 + .../v3beta1api/model_validation_error.go | 187 + ...model_validation_error_validation_inner.go | 185 + .../sqlserverflex/v3beta1api/model_version.go | 245 + services/sqlserverflex/v3beta1api/response.go | 48 + services/sqlserverflex/v3beta1api/utils.go | 362 + services/sqlserverflex/wait/deprecation.go | 2 + 341 files changed, 81042 insertions(+), 52 deletions(-) create mode 100644 services/sqlserverflex/v1api/api_default.go create mode 100644 services/sqlserverflex/v1api/api_default_mock.go create mode 100644 services/sqlserverflex/v1api/client.go create mode 100644 services/sqlserverflex/v1api/configuration.go create mode 100644 services/sqlserverflex/v1api/model_acl.go create mode 100644 services/sqlserverflex/v1api/model_backup.go create mode 100644 services/sqlserverflex/v1api/model_backup_list_backups_response_grouped.go create mode 100644 services/sqlserverflex/v1api/model_create_database_payload.go create mode 100644 services/sqlserverflex/v1api/model_create_database_response.go create mode 100644 services/sqlserverflex/v1api/model_create_instance_payload.go create mode 100644 services/sqlserverflex/v1api/model_create_instance_response.go create mode 100644 services/sqlserverflex/v1api/model_create_user_payload.go create mode 100644 services/sqlserverflex/v1api/model_create_user_response.go create mode 100644 services/sqlserverflex/v1api/model_data_point.go create mode 100644 services/sqlserverflex/v1api/model_database.go create mode 100644 services/sqlserverflex/v1api/model_database_documentation_create_database_request_options.go create mode 100644 services/sqlserverflex/v1api/model_database_options.go create mode 100644 services/sqlserverflex/v1api/model_flavor.go create mode 100644 services/sqlserverflex/v1api/model_get_backup_response.go create mode 100644 services/sqlserverflex/v1api/model_get_database_response.go create mode 100644 services/sqlserverflex/v1api/model_get_instance_response.go create mode 100644 services/sqlserverflex/v1api/model_get_user_response.go create mode 100644 services/sqlserverflex/v1api/model_host.go create mode 100644 services/sqlserverflex/v1api/model_host_metric.go create mode 100644 services/sqlserverflex/v1api/model_instance.go create mode 100644 services/sqlserverflex/v1api/model_instance_documentation_acl.go create mode 100644 services/sqlserverflex/v1api/model_instance_documentation_options.go create mode 100644 services/sqlserverflex/v1api/model_instance_documentation_storage.go create mode 100644 services/sqlserverflex/v1api/model_instance_error.go create mode 100644 services/sqlserverflex/v1api/model_instance_flavor_entry.go create mode 100644 services/sqlserverflex/v1api/model_instance_list_instance.go create mode 100644 services/sqlserverflex/v1api/model_instance_list_user.go create mode 100644 services/sqlserverflex/v1api/model_list_backups_response.go create mode 100644 services/sqlserverflex/v1api/model_list_collations_response.go create mode 100644 services/sqlserverflex/v1api/model_list_compatibility_response.go create mode 100644 services/sqlserverflex/v1api/model_list_databases_response.go create mode 100644 services/sqlserverflex/v1api/model_list_flavors_response.go create mode 100644 services/sqlserverflex/v1api/model_list_instances_response.go create mode 100644 services/sqlserverflex/v1api/model_list_metrics_response.go create mode 100644 services/sqlserverflex/v1api/model_list_restore_jobs_response.go create mode 100644 services/sqlserverflex/v1api/model_list_roles_response.go create mode 100644 services/sqlserverflex/v1api/model_list_storages_response.go create mode 100644 services/sqlserverflex/v1api/model_list_users_response.go create mode 100644 services/sqlserverflex/v1api/model_list_versions_response.go create mode 100644 services/sqlserverflex/v1api/model_mssql_database_collation.go create mode 100644 services/sqlserverflex/v1api/model_mssql_database_compatibility.go create mode 100644 services/sqlserverflex/v1api/model_partial_update_instance_payload.go create mode 100644 services/sqlserverflex/v1api/model_reset_user_response.go create mode 100644 services/sqlserverflex/v1api/model_restore_running_restore.go create mode 100644 services/sqlserverflex/v1api/model_single_database.go create mode 100644 services/sqlserverflex/v1api/model_single_user.go create mode 100644 services/sqlserverflex/v1api/model_storage.go create mode 100644 services/sqlserverflex/v1api/model_storage_range.go create mode 100644 services/sqlserverflex/v1api/model_trigger_database_restore_payload.go create mode 100644 services/sqlserverflex/v1api/model_type.go create mode 100644 services/sqlserverflex/v1api/model_update_instance_payload.go create mode 100644 services/sqlserverflex/v1api/model_update_instance_response.go create mode 100644 services/sqlserverflex/v1api/model_user.go create mode 100644 services/sqlserverflex/v1api/model_user_response_user.go create mode 100644 services/sqlserverflex/v1api/response.go create mode 100644 services/sqlserverflex/v1api/utils.go create mode 100644 services/sqlserverflex/v2api/api_default.go create mode 100644 services/sqlserverflex/v2api/api_default_mock.go create mode 100644 services/sqlserverflex/v2api/client.go create mode 100644 services/sqlserverflex/v2api/configuration.go create mode 100644 services/sqlserverflex/v2api/model_acl.go create mode 100644 services/sqlserverflex/v2api/model_backup.go create mode 100644 services/sqlserverflex/v2api/model_backup_list_backups_response_grouped.go create mode 100644 services/sqlserverflex/v2api/model_create_database_payload.go create mode 100644 services/sqlserverflex/v2api/model_create_database_response.go create mode 100644 services/sqlserverflex/v2api/model_create_instance_payload.go create mode 100644 services/sqlserverflex/v2api/model_create_instance_response.go create mode 100644 services/sqlserverflex/v2api/model_create_user_payload.go create mode 100644 services/sqlserverflex/v2api/model_create_user_response.go create mode 100644 services/sqlserverflex/v2api/model_data_point.go create mode 100644 services/sqlserverflex/v2api/model_database.go create mode 100644 services/sqlserverflex/v2api/model_database_documentation_create_database_request_options.go create mode 100644 services/sqlserverflex/v2api/model_database_options.go create mode 100644 services/sqlserverflex/v2api/model_flavor.go create mode 100644 services/sqlserverflex/v2api/model_get_backup_response.go create mode 100644 services/sqlserverflex/v2api/model_get_database_response.go create mode 100644 services/sqlserverflex/v2api/model_get_instance_response.go create mode 100644 services/sqlserverflex/v2api/model_get_user_response.go create mode 100644 services/sqlserverflex/v2api/model_host.go create mode 100644 services/sqlserverflex/v2api/model_host_metric.go create mode 100644 services/sqlserverflex/v2api/model_instance.go create mode 100644 services/sqlserverflex/v2api/model_instance_documentation_acl.go create mode 100644 services/sqlserverflex/v2api/model_instance_documentation_options.go create mode 100644 services/sqlserverflex/v2api/model_instance_documentation_storage.go create mode 100644 services/sqlserverflex/v2api/model_instance_error.go create mode 100644 services/sqlserverflex/v2api/model_instance_flavor_entry.go create mode 100644 services/sqlserverflex/v2api/model_instance_list_instance.go create mode 100644 services/sqlserverflex/v2api/model_instance_list_user.go create mode 100644 services/sqlserverflex/v2api/model_list_backups_response.go create mode 100644 services/sqlserverflex/v2api/model_list_collations_response.go create mode 100644 services/sqlserverflex/v2api/model_list_compatibility_response.go create mode 100644 services/sqlserverflex/v2api/model_list_databases_response.go create mode 100644 services/sqlserverflex/v2api/model_list_flavors_response.go create mode 100644 services/sqlserverflex/v2api/model_list_instances_response.go create mode 100644 services/sqlserverflex/v2api/model_list_metrics_response.go create mode 100644 services/sqlserverflex/v2api/model_list_restore_jobs_response.go create mode 100644 services/sqlserverflex/v2api/model_list_roles_response.go create mode 100644 services/sqlserverflex/v2api/model_list_storages_response.go create mode 100644 services/sqlserverflex/v2api/model_list_users_response.go create mode 100644 services/sqlserverflex/v2api/model_list_versions_response.go create mode 100644 services/sqlserverflex/v2api/model_mssql_database_collation.go create mode 100644 services/sqlserverflex/v2api/model_mssql_database_compatibility.go create mode 100644 services/sqlserverflex/v2api/model_partial_update_instance_payload.go create mode 100644 services/sqlserverflex/v2api/model_reset_user_response.go create mode 100644 services/sqlserverflex/v2api/model_restore_running_restore.go create mode 100644 services/sqlserverflex/v2api/model_single_database.go create mode 100644 services/sqlserverflex/v2api/model_single_user.go create mode 100644 services/sqlserverflex/v2api/model_storage.go create mode 100644 services/sqlserverflex/v2api/model_storage_range.go create mode 100644 services/sqlserverflex/v2api/model_trigger_database_restore_payload.go create mode 100644 services/sqlserverflex/v2api/model_type.go create mode 100644 services/sqlserverflex/v2api/model_update_instance_payload.go create mode 100644 services/sqlserverflex/v2api/model_update_instance_response.go create mode 100644 services/sqlserverflex/v2api/model_user.go create mode 100644 services/sqlserverflex/v2api/model_user_response_user.go create mode 100644 services/sqlserverflex/v2api/response.go create mode 100644 services/sqlserverflex/v2api/utils.go create mode 100644 services/sqlserverflex/v3alpha1api/api_default.go create mode 100644 services/sqlserverflex/v3alpha1api/api_default_mock.go create mode 100644 services/sqlserverflex/v3alpha1api/client.go create mode 100644 services/sqlserverflex/v3alpha1api/configuration.go create mode 100644 services/sqlserverflex/v3alpha1api/model_backup_running_restore.go create mode 100644 services/sqlserverflex/v3alpha1api/model_backup_sort.go create mode 100644 services/sqlserverflex/v3alpha1api/model_create_database_request_payload.go create mode 100644 services/sqlserverflex/v3alpha1api/model_create_database_response.go create mode 100644 services/sqlserverflex/v3alpha1api/model_create_instance_request_payload.go create mode 100644 services/sqlserverflex/v3alpha1api/model_create_instance_request_payload_network.go create mode 100644 services/sqlserverflex/v3alpha1api/model_create_instance_response.go create mode 100644 services/sqlserverflex/v3alpha1api/model_create_user_request_payload.go create mode 100644 services/sqlserverflex/v3alpha1api/model_create_user_response.go create mode 100644 services/sqlserverflex/v3alpha1api/model_database_getcollation.go create mode 100644 services/sqlserverflex/v3alpha1api/model_database_getcompatibility.go create mode 100644 services/sqlserverflex/v3alpha1api/model_database_roles.go create mode 100644 services/sqlserverflex/v3alpha1api/model_database_sort.go create mode 100644 services/sqlserverflex/v3alpha1api/model_error.go create mode 100644 services/sqlserverflex/v3alpha1api/model_external_s3.go create mode 100644 services/sqlserverflex/v3alpha1api/model_flavor_sort.go create mode 100644 services/sqlserverflex/v3alpha1api/model_flavor_storage_classes_storage_class.go create mode 100644 services/sqlserverflex/v3alpha1api/model_flavor_storage_range.go create mode 100644 services/sqlserverflex/v3alpha1api/model_get_backup_response.go create mode 100644 services/sqlserverflex/v3alpha1api/model_get_collations_response.go create mode 100644 services/sqlserverflex/v3alpha1api/model_get_database_response.go create mode 100644 services/sqlserverflex/v3alpha1api/model_get_flavors_response.go create mode 100644 services/sqlserverflex/v3alpha1api/model_get_instance_response.go create mode 100644 services/sqlserverflex/v3alpha1api/model_get_storages_response.go create mode 100644 services/sqlserverflex/v3alpha1api/model_get_user_response.go create mode 100644 services/sqlserverflex/v3alpha1api/model_get_versions_response.go create mode 100644 services/sqlserverflex/v3alpha1api/model_instance_edition.go create mode 100644 services/sqlserverflex/v3alpha1api/model_instance_encryption.go create mode 100644 services/sqlserverflex/v3alpha1api/model_instance_network.go create mode 100644 services/sqlserverflex/v3alpha1api/model_instance_network_access_scope.go create mode 100644 services/sqlserverflex/v3alpha1api/model_instance_sort.go create mode 100644 services/sqlserverflex/v3alpha1api/model_instance_version.go create mode 100644 services/sqlserverflex/v3alpha1api/model_instance_version_opt.go create mode 100644 services/sqlserverflex/v3alpha1api/model_list_backup.go create mode 100644 services/sqlserverflex/v3alpha1api/model_list_backup_response.go create mode 100644 services/sqlserverflex/v3alpha1api/model_list_backups_response.go create mode 100644 services/sqlserverflex/v3alpha1api/model_list_compatibility_response.go create mode 100644 services/sqlserverflex/v3alpha1api/model_list_current_running_restore_jobs.go create mode 100644 services/sqlserverflex/v3alpha1api/model_list_database.go create mode 100644 services/sqlserverflex/v3alpha1api/model_list_databases_response.go create mode 100644 services/sqlserverflex/v3alpha1api/model_list_flavors.go create mode 100644 services/sqlserverflex/v3alpha1api/model_list_instance.go create mode 100644 services/sqlserverflex/v3alpha1api/model_list_instances_response.go create mode 100644 services/sqlserverflex/v3alpha1api/model_list_roles_response.go create mode 100644 services/sqlserverflex/v3alpha1api/model_list_user.go create mode 100644 services/sqlserverflex/v3alpha1api/model_list_user_response.go create mode 100644 services/sqlserverflex/v3alpha1api/model_pagination.go create mode 100644 services/sqlserverflex/v3alpha1api/model_protect_instance_request_payload.go create mode 100644 services/sqlserverflex/v3alpha1api/model_protect_instance_response.go create mode 100644 services/sqlserverflex/v3alpha1api/model_replicas.go create mode 100644 services/sqlserverflex/v3alpha1api/model_replicas_opt.go create mode 100644 services/sqlserverflex/v3alpha1api/model_reset_user_response.go create mode 100644 services/sqlserverflex/v3alpha1api/model_restore_database_from_backup_payload.go create mode 100644 services/sqlserverflex/v3alpha1api/model_restore_database_from_backup_payload_source.go create mode 100644 services/sqlserverflex/v3alpha1api/model_s3file_info.go create mode 100644 services/sqlserverflex/v3alpha1api/model_source_backup.go create mode 100644 services/sqlserverflex/v3alpha1api/model_source_external_s3.go create mode 100644 services/sqlserverflex/v3alpha1api/model_status.go create mode 100644 services/sqlserverflex/v3alpha1api/model_storage.go create mode 100644 services/sqlserverflex/v3alpha1api/model_storage_create.go create mode 100644 services/sqlserverflex/v3alpha1api/model_storage_update.go create mode 100644 services/sqlserverflex/v3alpha1api/model_trigger_restore_request_payload.go create mode 100644 services/sqlserverflex/v3alpha1api/model_update_instance_partially_request_payload.go create mode 100644 services/sqlserverflex/v3alpha1api/model_update_instance_partially_request_payload_network.go create mode 100644 services/sqlserverflex/v3alpha1api/model_update_instance_request_payload.go create mode 100644 services/sqlserverflex/v3alpha1api/model_update_instance_request_payload_network.go create mode 100644 services/sqlserverflex/v3alpha1api/model_user_sort.go create mode 100644 services/sqlserverflex/v3alpha1api/model_validation_error.go create mode 100644 services/sqlserverflex/v3alpha1api/model_validation_error_validation_inner.go create mode 100644 services/sqlserverflex/v3alpha1api/model_version.go create mode 100644 services/sqlserverflex/v3alpha1api/response.go create mode 100644 services/sqlserverflex/v3alpha1api/utils.go create mode 100644 services/sqlserverflex/v3beta1api/api_default.go create mode 100644 services/sqlserverflex/v3beta1api/api_default_mock.go create mode 100644 services/sqlserverflex/v3beta1api/client.go create mode 100644 services/sqlserverflex/v3beta1api/configuration.go create mode 100644 services/sqlserverflex/v3beta1api/model_backup_running_restore.go create mode 100644 services/sqlserverflex/v3beta1api/model_backup_sort.go create mode 100644 services/sqlserverflex/v3beta1api/model_create_database_request_payload.go create mode 100644 services/sqlserverflex/v3beta1api/model_create_database_response.go create mode 100644 services/sqlserverflex/v3beta1api/model_create_instance_request_payload.go create mode 100644 services/sqlserverflex/v3beta1api/model_create_instance_request_payload_network.go create mode 100644 services/sqlserverflex/v3beta1api/model_create_instance_response.go create mode 100644 services/sqlserverflex/v3beta1api/model_create_user_request_payload.go create mode 100644 services/sqlserverflex/v3beta1api/model_create_user_response.go create mode 100644 services/sqlserverflex/v3beta1api/model_database_getcollation.go create mode 100644 services/sqlserverflex/v3beta1api/model_database_getcompatibility.go create mode 100644 services/sqlserverflex/v3beta1api/model_database_roles.go create mode 100644 services/sqlserverflex/v3beta1api/model_database_sort.go create mode 100644 services/sqlserverflex/v3beta1api/model_error.go create mode 100644 services/sqlserverflex/v3beta1api/model_external_s3.go create mode 100644 services/sqlserverflex/v3beta1api/model_flavor_sort.go create mode 100644 services/sqlserverflex/v3beta1api/model_flavor_storage_classes_storage_class.go create mode 100644 services/sqlserverflex/v3beta1api/model_flavor_storage_range.go create mode 100644 services/sqlserverflex/v3beta1api/model_get_backup_response.go create mode 100644 services/sqlserverflex/v3beta1api/model_get_collations_response.go create mode 100644 services/sqlserverflex/v3beta1api/model_get_database_response.go create mode 100644 services/sqlserverflex/v3beta1api/model_get_flavors_response.go create mode 100644 services/sqlserverflex/v3beta1api/model_get_instance_response.go create mode 100644 services/sqlserverflex/v3beta1api/model_get_storages_response.go create mode 100644 services/sqlserverflex/v3beta1api/model_get_user_response.go create mode 100644 services/sqlserverflex/v3beta1api/model_get_versions_response.go create mode 100644 services/sqlserverflex/v3beta1api/model_instance_edition.go create mode 100644 services/sqlserverflex/v3beta1api/model_instance_encryption.go create mode 100644 services/sqlserverflex/v3beta1api/model_instance_network.go create mode 100644 services/sqlserverflex/v3beta1api/model_instance_network_access_scope.go create mode 100644 services/sqlserverflex/v3beta1api/model_instance_sort.go create mode 100644 services/sqlserverflex/v3beta1api/model_instance_version.go create mode 100644 services/sqlserverflex/v3beta1api/model_instance_version_opt.go create mode 100644 services/sqlserverflex/v3beta1api/model_list_backup.go create mode 100644 services/sqlserverflex/v3beta1api/model_list_backup_response.go create mode 100644 services/sqlserverflex/v3beta1api/model_list_backups_response.go create mode 100644 services/sqlserverflex/v3beta1api/model_list_compatibility_response.go create mode 100644 services/sqlserverflex/v3beta1api/model_list_current_running_restore_jobs.go create mode 100644 services/sqlserverflex/v3beta1api/model_list_database.go create mode 100644 services/sqlserverflex/v3beta1api/model_list_databases_response.go create mode 100644 services/sqlserverflex/v3beta1api/model_list_flavors.go create mode 100644 services/sqlserverflex/v3beta1api/model_list_instance.go create mode 100644 services/sqlserverflex/v3beta1api/model_list_instances_response.go create mode 100644 services/sqlserverflex/v3beta1api/model_list_roles_response.go create mode 100644 services/sqlserverflex/v3beta1api/model_list_user.go create mode 100644 services/sqlserverflex/v3beta1api/model_list_user_response.go create mode 100644 services/sqlserverflex/v3beta1api/model_pagination.go create mode 100644 services/sqlserverflex/v3beta1api/model_protect_instance_request_payload.go create mode 100644 services/sqlserverflex/v3beta1api/model_protect_instance_response.go create mode 100644 services/sqlserverflex/v3beta1api/model_replicas.go create mode 100644 services/sqlserverflex/v3beta1api/model_replicas_opt.go create mode 100644 services/sqlserverflex/v3beta1api/model_reset_user_response.go create mode 100644 services/sqlserverflex/v3beta1api/model_restore_database_from_backup_payload.go create mode 100644 services/sqlserverflex/v3beta1api/model_restore_database_from_backup_payload_source.go create mode 100644 services/sqlserverflex/v3beta1api/model_s3file_info.go create mode 100644 services/sqlserverflex/v3beta1api/model_source_backup.go create mode 100644 services/sqlserverflex/v3beta1api/model_source_external_s3.go create mode 100644 services/sqlserverflex/v3beta1api/model_status.go create mode 100644 services/sqlserverflex/v3beta1api/model_storage.go create mode 100644 services/sqlserverflex/v3beta1api/model_storage_create.go create mode 100644 services/sqlserverflex/v3beta1api/model_storage_update.go create mode 100644 services/sqlserverflex/v3beta1api/model_trigger_restore_request_payload.go create mode 100644 services/sqlserverflex/v3beta1api/model_update_instance_partially_request_payload.go create mode 100644 services/sqlserverflex/v3beta1api/model_update_instance_partially_request_payload_network.go create mode 100644 services/sqlserverflex/v3beta1api/model_update_instance_request_payload.go create mode 100644 services/sqlserverflex/v3beta1api/model_update_instance_request_payload_network.go create mode 100644 services/sqlserverflex/v3beta1api/model_user_sort.go create mode 100644 services/sqlserverflex/v3beta1api/model_validation_error.go create mode 100644 services/sqlserverflex/v3beta1api/model_validation_error_validation_inner.go create mode 100644 services/sqlserverflex/v3beta1api/model_version.go create mode 100644 services/sqlserverflex/v3beta1api/response.go create mode 100644 services/sqlserverflex/v3beta1api/utils.go create mode 100644 services/sqlserverflex/wait/deprecation.go diff --git a/services/sqlserverflex/api_default.go b/services/sqlserverflex/api_default.go index 6fb845534..d01eda73a 100644 --- a/services/sqlserverflex/api_default.go +++ b/services/sqlserverflex/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 sqlserverflex 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 { /* CreateDatabase Create a Database @@ -33,6 +35,8 @@ type DefaultApi interface { @param instanceId Instance ID @param region The region which should be addressed @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, instanceId string, region string) ApiCreateDatabaseRequest /* @@ -44,6 +48,7 @@ type DefaultApi interface { @param region The region which should be addressed @return CreateDatabaseResponse + // 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, instanceId string, region string) (*CreateDatabaseResponse, error) /* @@ -54,6 +59,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 /* @@ -64,6 +71,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) /* @@ -75,6 +83,8 @@ type DefaultApi interface { @param instanceId Instance ID @param region The region which should be addressed @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, instanceId string, region string) ApiCreateUserRequest /* @@ -86,6 +96,7 @@ type DefaultApi interface { @param region The region which should be addressed @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, instanceId string, region string) (*CreateUserResponse, error) /* @@ -98,11 +109,14 @@ type DefaultApi interface { @param databaseName Database Name @param region The region which should be addressed @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, instanceId string, databaseName string, region 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, instanceId string, databaseName string, region string) error /* @@ -114,11 +128,14 @@ type DefaultApi interface { @param instanceId Instance ID @param region The region which should be addressed @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, instanceId string, region 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, instanceId string, region string) error /* @@ -131,11 +148,14 @@ type DefaultApi interface { @param userId User ID @param region The region which should be addressed @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, instanceId string, userId string, region 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, instanceId string, userId string, region string) error /* @@ -148,6 +168,8 @@ type DefaultApi interface { @param backupId Backup ID @param region The region which should be addressed @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, instanceId string, backupId string, region string) ApiGetBackupRequest /* @@ -160,6 +182,7 @@ type DefaultApi interface { @param region The region which should be addressed @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, instanceId string, backupId string, region string) (*GetBackupResponse, error) /* @@ -172,6 +195,8 @@ type DefaultApi interface { @param databaseName Database Name @param region The region which should be addressed @return ApiGetDatabaseRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetDatabase(ctx context.Context, projectId string, instanceId string, databaseName string, region string) ApiGetDatabaseRequest /* @@ -184,6 +209,7 @@ type DefaultApi interface { @param region The region which should be addressed @return GetDatabaseResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetDatabaseExecute(ctx context.Context, projectId string, instanceId string, databaseName string, region string) (*GetDatabaseResponse, error) /* @@ -195,6 +221,8 @@ type DefaultApi interface { @param instanceId Instance ID @param region The region which should be addressed @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, instanceId string, region string) ApiGetInstanceRequest /* @@ -206,6 +234,7 @@ type DefaultApi interface { @param region The region which should be addressed @return GetInstanceResponse + // 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, instanceId string, region string) (*GetInstanceResponse, error) /* @@ -218,6 +247,8 @@ type DefaultApi interface { @param userId User ID @param region The region which should be addressed @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, instanceId string, userId string, region string) ApiGetUserRequest /* @@ -230,6 +261,7 @@ type DefaultApi interface { @param region The region which should be addressed @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, instanceId string, userId string, region string) (*GetUserResponse, error) /* @@ -241,6 +273,8 @@ type DefaultApi interface { @param instanceId Instance ID @param region The region which should be addressed @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, instanceId string, region string) ApiListBackupsRequest /* @@ -252,6 +286,7 @@ type DefaultApi interface { @param region The region which should be addressed @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, instanceId string, region string) (*ListBackupsResponse, error) /* @@ -263,6 +298,8 @@ type DefaultApi interface { @param instanceId The ID of the instance @param region The region which should be addressed @return ApiListCollationsRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListCollations(ctx context.Context, projectId string, instanceId string, region string) ApiListCollationsRequest /* @@ -274,6 +311,7 @@ type DefaultApi interface { @param region The region which should be addressed @return ListCollationsResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListCollationsExecute(ctx context.Context, projectId string, instanceId string, region string) (*ListCollationsResponse, error) /* @@ -285,6 +323,8 @@ type DefaultApi interface { @param instanceId The ID of the instance @param region The region which should be addressed @return ApiListCompatibilityRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListCompatibility(ctx context.Context, projectId string, instanceId string, region string) ApiListCompatibilityRequest /* @@ -296,6 +336,7 @@ type DefaultApi interface { @param region The region which should be addressed @return ListCompatibilityResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListCompatibilityExecute(ctx context.Context, projectId string, instanceId string, region string) (*ListCompatibilityResponse, error) /* @@ -307,6 +348,8 @@ type DefaultApi interface { @param instanceId Instance ID @param region The region which should be addressed @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, instanceId string, region string) ApiListDatabasesRequest /* @@ -318,6 +361,7 @@ type DefaultApi interface { @param region The region which should be addressed @return ListDatabasesResponse + // 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, instanceId string, region string) (*ListDatabasesResponse, error) /* @@ -328,6 +372,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 /* @@ -338,6 +384,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) /* @@ -348,6 +395,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 /* @@ -358,6 +407,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) /* @@ -370,6 +420,8 @@ type DefaultApi interface { @param region The region which should be addressed @param metric The name of the metric. Valid metrics are 'cpu', 'memory', 'data-disk-size', 'data-disk-use','log-disk-size', 'log-disk-use', 'life-expectancy' and 'connections'. @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, instanceId string, region string, metric string) ApiListMetricsRequest /* @@ -382,6 +434,7 @@ type DefaultApi interface { @param metric The name of the metric. Valid metrics are 'cpu', 'memory', 'data-disk-size', 'data-disk-use','log-disk-size', 'log-disk-use', 'life-expectancy' and 'connections'. @return ListMetricsResponse + // 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, instanceId string, region string, metric string) (*ListMetricsResponse, error) /* @@ -393,6 +446,8 @@ type DefaultApi interface { @param instanceId Instance ID @param region The region which should be addressed @return ApiListRestoreJobsRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListRestoreJobs(ctx context.Context, projectId string, instanceId string, region string) ApiListRestoreJobsRequest /* @@ -404,6 +459,7 @@ type DefaultApi interface { @param region The region which should be addressed @return ListRestoreJobsResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListRestoreJobsExecute(ctx context.Context, projectId string, instanceId string, region string) (*ListRestoreJobsResponse, error) /* @@ -415,6 +471,8 @@ type DefaultApi interface { @param instanceId Instance ID @param region The region which should be addressed @return ApiListRolesRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListRoles(ctx context.Context, projectId string, instanceId string, region string) ApiListRolesRequest /* @@ -426,6 +484,7 @@ type DefaultApi interface { @param region The region which should be addressed @return ListRolesResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListRolesExecute(ctx context.Context, projectId string, instanceId string, region string) (*ListRolesResponse, error) /* @@ -437,6 +496,8 @@ type DefaultApi interface { @param flavorId Flavor ID @param region The region which should be addressed @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, flavorId string, region string) ApiListStoragesRequest /* @@ -448,6 +509,7 @@ type DefaultApi interface { @param region The region which should be addressed @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, flavorId string, region string) (*ListStoragesResponse, error) /* @@ -459,6 +521,8 @@ type DefaultApi interface { @param instanceId Instance ID @param region The region which should be addressed @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, instanceId string, region string) ApiListUsersRequest /* @@ -470,6 +534,7 @@ type DefaultApi interface { @param region The region which should be addressed @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, instanceId string, region string) (*ListUsersResponse, error) /* @@ -480,6 +545,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 /* @@ -490,6 +557,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) /* @@ -504,6 +572,8 @@ type DefaultApi interface { @param instanceId Instance ID @param region The region which should be addressed @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, instanceId string, region string) ApiPartialUpdateInstanceRequest /* @@ -515,6 +585,7 @@ type DefaultApi interface { @param region The region which should be addressed @return UpdateInstanceResponse + // 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, instanceId string, region string) (*UpdateInstanceResponse, error) /* @@ -527,6 +598,8 @@ type DefaultApi interface { @param userId user ID @param region The region which should be addressed @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, instanceId string, userId string, region string) ApiResetUserRequest /* @@ -539,6 +612,7 @@ type DefaultApi interface { @param region The region which should be addressed @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, instanceId string, userId string, region string) (*ResetUserResponse, error) /* @@ -549,11 +623,14 @@ type DefaultApi interface { @param projectId Project ID @param region The region which should be addressed @return ApiTerminateProjectRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ TerminateProject(ctx context.Context, projectId string, region string) ApiTerminateProjectRequest /* TerminateProjectExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ TerminateProjectExecute(ctx context.Context, projectId string, region string) error /* @@ -566,11 +643,14 @@ type DefaultApi interface { @param databaseName Database Name @param region The region which should be addressed @return ApiTriggerDatabaseBackupRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ TriggerDatabaseBackup(ctx context.Context, projectId string, instanceId string, databaseName string, region string) ApiTriggerDatabaseBackupRequest /* TriggerDatabaseBackupExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ TriggerDatabaseBackupExecute(ctx context.Context, projectId string, instanceId string, databaseName string, region string) error /* @@ -583,11 +663,14 @@ type DefaultApi interface { @param databaseName Database Name @param region The region which should be addressed @return ApiTriggerDatabaseRestoreRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ TriggerDatabaseRestore(ctx context.Context, projectId string, instanceId string, databaseName string, region string) ApiTriggerDatabaseRestoreRequest /* TriggerDatabaseRestoreExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ TriggerDatabaseRestoreExecute(ctx context.Context, projectId string, instanceId string, databaseName string, region string) error /* @@ -602,6 +685,8 @@ type DefaultApi interface { @param instanceId Instance ID @param region The region which should be addressed @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, instanceId string, region string) ApiUpdateInstanceRequest /* @@ -613,147 +698,217 @@ type DefaultApi interface { @param region The region which should be addressed @return UpdateInstanceResponse + // 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, instanceId string, region string) (*UpdateInstanceResponse, 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() (*CreateDatabaseResponse, 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 { // The request body contains a username, a list of roles and database. The possible roles can be fetched from the ListRoles endpoint. + // 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 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 ApiGetDatabaseRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*GetDatabaseResponse, 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() (*GetInstanceResponse, 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 ApiListCollationsRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*ListCollationsResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListCompatibilityRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*ListCompatibilityResponse, 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() (*ListDatabasesResponse, 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() (*ListMetricsResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListRestoreJobsRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*ListRestoreJobsResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListRolesRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*ListRolesResponse, 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() (*UpdateInstanceResponse, 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 ApiTerminateProjectRequest 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 ApiTriggerDatabaseBackupRequest 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 ApiTriggerDatabaseRestoreRequest interface { // Body + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead TriggerDatabaseRestorePayload(triggerDatabaseRestorePayload TriggerDatabaseRestorePayload) ApiTriggerDatabaseRestoreRequest + // 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() (*UpdateInstanceResponse, 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 CreateDatabaseRequest struct { ctx context.Context apiService *DefaultApiService @@ -764,12 +919,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() (*CreateDatabaseResponse, error) { var ( localVarHTTPMethod = http.MethodPost @@ -891,7 +1047,7 @@ func (r CreateDatabaseRequest) Execute() (*CreateDatabaseResponse, error) { /* CreateDatabase: Create a Database -Create a 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 @@ -909,6 +1065,7 @@ func (a *APIClient) CreateDatabase(ctx context.Context, projectId string, instan } } +// 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, instanceId string, region string) (*CreateDatabaseResponse, error) { r := CreateDatabaseRequest{ apiService: a.defaultApi, @@ -920,6 +1077,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 @@ -929,12 +1087,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 @@ -1055,7 +1214,7 @@ func (r CreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { /* CreateInstance: Create Instance -Create a new instance of a sqlServerCRD 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 @@ -1071,6 +1230,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, @@ -1081,6 +1241,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 @@ -1091,12 +1252,13 @@ type CreateUserRequest struct { } // The request body contains a username, a list of roles and database. The possible roles can be fetched from the ListRoles endpoint. - +// 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 @@ -1218,7 +1380,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 @@ -1236,6 +1398,7 @@ func (a *APIClient) CreateUser(ctx context.Context, projectId string, instanceId } } +// 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, instanceId string, region string) (*CreateUserResponse, error) { r := CreateUserRequest{ apiService: a.defaultApi, @@ -1247,6 +1410,7 @@ func (a *APIClient) CreateUserExecute(ctx context.Context, projectId string, ins 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 @@ -1256,6 +1420,7 @@ type DeleteDatabaseRequest struct { region 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 @@ -1362,7 +1527,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 @@ -1382,6 +1547,7 @@ func (a *APIClient) DeleteDatabase(ctx context.Context, projectId string, instan } } +// 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, instanceId string, databaseName string, region string) error { r := DeleteDatabaseRequest{ apiService: a.defaultApi, @@ -1394,6 +1560,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 @@ -1402,6 +1569,7 @@ type DeleteInstanceRequest struct { region 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 @@ -1507,7 +1675,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 @@ -1525,6 +1693,7 @@ func (a *APIClient) DeleteInstance(ctx context.Context, projectId string, instan } } +// 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, instanceId string, region string) error { r := DeleteInstanceRequest{ apiService: a.defaultApi, @@ -1536,6 +1705,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 @@ -1545,6 +1715,7 @@ type DeleteUserRequest struct { region 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 @@ -1651,7 +1822,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 @@ -1671,6 +1842,7 @@ func (a *APIClient) DeleteUser(ctx context.Context, projectId string, instanceId } } +// 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, instanceId string, userId string, region string) error { r := DeleteUserRequest{ apiService: a.defaultApi, @@ -1683,6 +1855,7 @@ func (a *APIClient) DeleteUserExecute(ctx context.Context, projectId string, ins 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 @@ -1692,6 +1865,7 @@ type GetBackupRequest struct { region 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 @@ -1809,7 +1983,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 @@ -1829,6 +2003,7 @@ func (a *APIClient) GetBackup(ctx context.Context, projectId string, instanceId } } +// 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, instanceId string, backupId string, region string) (*GetBackupResponse, error) { r := GetBackupRequest{ apiService: a.defaultApi, @@ -1841,6 +2016,7 @@ func (a *APIClient) GetBackupExecute(ctx context.Context, projectId string, inst return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetDatabaseRequest struct { ctx context.Context apiService *DefaultApiService @@ -1850,6 +2026,7 @@ type GetDatabaseRequest struct { region string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetDatabaseRequest) Execute() (*GetDatabaseResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -1967,7 +2144,7 @@ func (r GetDatabaseRequest) Execute() (*GetDatabaseResponse, error) { /* GetDatabase: Get specific Database -Get specific available 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 @@ -1987,6 +2164,7 @@ func (a *APIClient) GetDatabase(ctx context.Context, projectId string, instanceI } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetDatabaseExecute(ctx context.Context, projectId string, instanceId string, databaseName string, region string) (*GetDatabaseResponse, error) { r := GetDatabaseRequest{ apiService: a.defaultApi, @@ -1999,6 +2177,7 @@ func (a *APIClient) GetDatabaseExecute(ctx context.Context, projectId string, in 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 @@ -2007,6 +2186,7 @@ type GetInstanceRequest struct { region string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetInstanceRequest) Execute() (*GetInstanceResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -2123,7 +2303,7 @@ func (r GetInstanceRequest) Execute() (*GetInstanceResponse, 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 @@ -2141,6 +2321,7 @@ func (a *APIClient) GetInstance(ctx context.Context, projectId string, instanceI } } +// 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, instanceId string, region string) (*GetInstanceResponse, error) { r := GetInstanceRequest{ apiService: a.defaultApi, @@ -2152,6 +2333,7 @@ func (a *APIClient) GetInstanceExecute(ctx context.Context, projectId string, in 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 @@ -2161,6 +2343,7 @@ type GetUserRequest struct { region 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 @@ -2299,7 +2482,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 @@ -2319,6 +2502,7 @@ func (a *APIClient) GetUser(ctx context.Context, projectId string, instanceId st } } +// 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, instanceId string, userId string, region string) (*GetUserResponse, error) { r := GetUserRequest{ apiService: a.defaultApi, @@ -2331,6 +2515,7 @@ func (a *APIClient) GetUserExecute(ctx context.Context, projectId string, instan 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 @@ -2339,6 +2524,7 @@ type ListBackupsRequest struct { region 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 @@ -2455,7 +2641,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 @@ -2473,6 +2659,7 @@ func (a *APIClient) ListBackups(ctx context.Context, projectId string, instanceI } } +// 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, instanceId string, region string) (*ListBackupsResponse, error) { r := ListBackupsRequest{ apiService: a.defaultApi, @@ -2484,6 +2671,7 @@ func (a *APIClient) ListBackupsExecute(ctx context.Context, projectId string, in return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListCollationsRequest struct { ctx context.Context apiService *DefaultApiService @@ -2492,6 +2680,7 @@ type ListCollationsRequest struct { region string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListCollationsRequest) Execute() (*ListCollationsResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -2629,7 +2818,7 @@ func (r ListCollationsRequest) Execute() (*ListCollationsResponse, error) { /* ListCollations: Get database collation list -Returns a list of collations +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 STACKIT project @@ -2647,6 +2836,7 @@ func (a *APIClient) ListCollations(ctx context.Context, projectId string, instan } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ListCollationsExecute(ctx context.Context, projectId string, instanceId string, region string) (*ListCollationsResponse, error) { r := ListCollationsRequest{ apiService: a.defaultApi, @@ -2658,6 +2848,7 @@ func (a *APIClient) ListCollationsExecute(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 ListCompatibilityRequest struct { ctx context.Context apiService *DefaultApiService @@ -2666,6 +2857,7 @@ type ListCompatibilityRequest struct { region string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListCompatibilityRequest) Execute() (*ListCompatibilityResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -2803,7 +2995,7 @@ func (r ListCompatibilityRequest) Execute() (*ListCompatibilityResponse, error) /* ListCompatibility: Get database compatibility list -Returns a list of compatibility levels for creating a new 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 The ID of the STACKIT project @@ -2821,6 +3013,7 @@ func (a *APIClient) ListCompatibility(ctx context.Context, projectId string, ins } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ListCompatibilityExecute(ctx context.Context, projectId string, instanceId string, region string) (*ListCompatibilityResponse, error) { r := ListCompatibilityRequest{ apiService: a.defaultApi, @@ -2832,6 +3025,7 @@ func (a *APIClient) ListCompatibilityExecute(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 ListDatabasesRequest struct { ctx context.Context apiService *DefaultApiService @@ -2840,6 +3034,7 @@ type ListDatabasesRequest struct { region string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListDatabasesRequest) Execute() (*ListDatabasesResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -2956,7 +3151,7 @@ func (r ListDatabasesRequest) Execute() (*ListDatabasesResponse, error) { /* ListDatabases: Get list of databases -Get list of all databases in the 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 @@ -2974,6 +3169,7 @@ func (a *APIClient) ListDatabases(ctx context.Context, projectId string, instanc } } +// 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, instanceId string, region string) (*ListDatabasesResponse, error) { r := ListDatabasesRequest{ apiService: a.defaultApi, @@ -2985,6 +3181,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 @@ -2992,6 +3189,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 @@ -3107,7 +3305,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 @@ -3123,6 +3321,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, @@ -3133,6 +3332,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 @@ -3140,6 +3340,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 @@ -3255,7 +3456,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 @@ -3271,6 +3472,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, @@ -3281,6 +3483,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 @@ -3295,33 +3498,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() (*ListMetricsResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -3462,7 +3666,7 @@ func (r ListMetricsRequest) Execute() (*ListMetricsResponse, 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. @@ -3482,6 +3686,7 @@ func (a *APIClient) ListMetrics(ctx context.Context, projectId string, instanceI } } +// 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, instanceId string, region string, metric string) (*ListMetricsResponse, error) { r := ListMetricsRequest{ apiService: a.defaultApi, @@ -3494,6 +3699,7 @@ func (a *APIClient) ListMetricsExecute(ctx context.Context, projectId string, in return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListRestoreJobsRequest struct { ctx context.Context apiService *DefaultApiService @@ -3502,6 +3708,7 @@ type ListRestoreJobsRequest struct { region string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListRestoreJobsRequest) Execute() (*ListRestoreJobsResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -3618,7 +3825,7 @@ func (r ListRestoreJobsRequest) Execute() (*ListRestoreJobsResponse, error) { /* ListRestoreJobs: List current running restore jobs -List all currently running restore jobs 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 @@ -3636,6 +3843,7 @@ func (a *APIClient) ListRestoreJobs(ctx context.Context, projectId string, insta } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ListRestoreJobsExecute(ctx context.Context, projectId string, instanceId string, region string) (*ListRestoreJobsResponse, error) { r := ListRestoreJobsRequest{ apiService: a.defaultApi, @@ -3647,6 +3855,7 @@ func (a *APIClient) ListRestoreJobsExecute(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 ListRolesRequest struct { ctx context.Context apiService *DefaultApiService @@ -3655,6 +3864,7 @@ type ListRolesRequest struct { region string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListRolesRequest) Execute() (*ListRolesResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -3771,7 +3981,7 @@ func (r ListRolesRequest) Execute() (*ListRolesResponse, error) { /* ListRoles: List Roles -List available roles for an instance that can be assigned to a user +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project ID @@ -3789,6 +3999,7 @@ func (a *APIClient) ListRoles(ctx context.Context, projectId string, instanceId } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ListRolesExecute(ctx context.Context, projectId string, instanceId string, region string) (*ListRolesResponse, error) { r := ListRolesRequest{ apiService: a.defaultApi, @@ -3800,6 +4011,7 @@ func (a *APIClient) ListRolesExecute(ctx context.Context, projectId string, inst 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 @@ -3808,6 +4020,7 @@ type ListStoragesRequest struct { region 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 @@ -3924,7 +4137,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 @@ -3942,6 +4155,7 @@ func (a *APIClient) ListStorages(ctx context.Context, projectId string, flavorId } } +// 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, flavorId string, region string) (*ListStoragesResponse, error) { r := ListStoragesRequest{ apiService: a.defaultApi, @@ -3953,6 +4167,7 @@ func (a *APIClient) ListStoragesExecute(ctx context.Context, projectId string, f 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 @@ -3961,6 +4176,7 @@ type ListUsersRequest struct { region 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 @@ -4077,7 +4293,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 @@ -4095,6 +4311,7 @@ func (a *APIClient) ListUsers(ctx context.Context, projectId string, instanceId } } +// 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, instanceId string, region string) (*ListUsersResponse, error) { r := ListUsersRequest{ apiService: a.defaultApi, @@ -4106,6 +4323,7 @@ func (a *APIClient) ListUsersExecute(ctx context.Context, projectId string, inst 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 @@ -4115,12 +4333,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 @@ -4239,7 +4458,7 @@ func (r ListVersionsRequest) Execute() (*ListVersionsResponse, error) { /* ListVersions: Get Versions -Get available versions for mssql 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 @@ -4255,6 +4474,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, @@ -4265,6 +4485,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 @@ -4275,12 +4496,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() (*UpdateInstanceResponse, error) { var ( localVarHTTPMethod = http.MethodPatch @@ -4402,9 +4624,7 @@ func (r PartialUpdateInstanceRequest) Execute() (*UpdateInstanceResponse, error) /* PartialUpdateInstance: Update Instance -Update available instance of a mssql database. - -**Please note that any changes applied via PUT or PATCH requests will initiate a reboot of the SQL Server Flex 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 @@ -4422,6 +4642,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, instanceId string, region string) (*UpdateInstanceResponse, error) { r := PartialUpdateInstanceRequest{ apiService: a.defaultApi, @@ -4433,6 +4654,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 ResetUserRequest struct { ctx context.Context apiService *DefaultApiService @@ -4442,6 +4664,7 @@ type ResetUserRequest struct { region 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 @@ -4580,7 +4803,7 @@ func (r ResetUserRequest) Execute() (*ResetUserResponse, error) { /* ResetUser: Reset User -Reset user password for a mssql 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 @@ -4600,6 +4823,7 @@ func (a *APIClient) ResetUser(ctx context.Context, projectId string, instanceId } } +// 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, instanceId string, userId string, region string) (*ResetUserResponse, error) { r := ResetUserRequest{ apiService: a.defaultApi, @@ -4612,6 +4836,7 @@ func (a *APIClient) ResetUserExecute(ctx context.Context, projectId string, inst return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type TerminateProjectRequest struct { ctx context.Context apiService *DefaultApiService @@ -4619,6 +4844,7 @@ type TerminateProjectRequest struct { region string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r TerminateProjectRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete @@ -4733,7 +4959,7 @@ func (r TerminateProjectRequest) Execute() error { /* TerminateProject: Terminate the Project -Termination is the deletion of a whole project which causes the deletion of all instances for this project. Only System with permission system.databases-project.remove is able to call this resource +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 @@ -4749,6 +4975,7 @@ func (a *APIClient) TerminateProject(ctx context.Context, projectId string, regi } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) TerminateProjectExecute(ctx context.Context, projectId string, region string) error { r := TerminateProjectRequest{ apiService: a.defaultApi, @@ -4759,6 +4986,7 @@ func (a *APIClient) TerminateProjectExecute(ctx context.Context, projectId strin return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type TriggerDatabaseBackupRequest struct { ctx context.Context apiService *DefaultApiService @@ -4768,6 +4996,7 @@ type TriggerDatabaseBackupRequest struct { region string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r TriggerDatabaseBackupRequest) Execute() error { var ( localVarHTTPMethod = http.MethodPost @@ -4895,7 +5124,7 @@ func (r TriggerDatabaseBackupRequest) Execute() error { /* TriggerDatabaseBackup: Trigger backup for a specific Database -Trigger backup for a specific 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 @@ -4915,6 +5144,7 @@ func (a *APIClient) TriggerDatabaseBackup(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) TriggerDatabaseBackupExecute(ctx context.Context, projectId string, instanceId string, databaseName string, region string) error { r := TriggerDatabaseBackupRequest{ apiService: a.defaultApi, @@ -4927,6 +5157,7 @@ func (a *APIClient) TriggerDatabaseBackupExecute(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 TriggerDatabaseRestoreRequest struct { ctx context.Context apiService *DefaultApiService @@ -4938,12 +5169,13 @@ type TriggerDatabaseRestoreRequest struct { } // Body - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r TriggerDatabaseRestoreRequest) TriggerDatabaseRestorePayload(triggerDatabaseRestorePayload TriggerDatabaseRestorePayload) ApiTriggerDatabaseRestoreRequest { r.triggerDatabaseRestorePayload = &triggerDatabaseRestorePayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r TriggerDatabaseRestoreRequest) Execute() error { var ( localVarHTTPMethod = http.MethodPost @@ -5076,7 +5308,7 @@ func (r TriggerDatabaseRestoreRequest) Execute() error { /* TriggerDatabaseRestore: Trigger restore for a specific Database -Trigger restore for a specific 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 @@ -5096,6 +5328,7 @@ func (a *APIClient) TriggerDatabaseRestore(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) TriggerDatabaseRestoreExecute(ctx context.Context, projectId string, instanceId string, databaseName string, region string) error { r := TriggerDatabaseRestoreRequest{ apiService: a.defaultApi, @@ -5108,6 +5341,7 @@ func (a *APIClient) TriggerDatabaseRestoreExecute(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 UpdateInstanceRequest struct { ctx context.Context apiService *DefaultApiService @@ -5118,12 +5352,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() (*UpdateInstanceResponse, error) { var ( localVarHTTPMethod = http.MethodPut @@ -5245,9 +5480,7 @@ func (r UpdateInstanceRequest) Execute() (*UpdateInstanceResponse, error) { /* UpdateInstance: Update Instance -Update available instance of a mssql database. - -**Please note that any changes applied via PUT or PATCH requests will initiate a reboot of the SQL Server Flex 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 @@ -5265,6 +5498,7 @@ func (a *APIClient) UpdateInstance(ctx context.Context, projectId string, instan } } +// 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, instanceId string, region string) (*UpdateInstanceResponse, error) { r := UpdateInstanceRequest{ apiService: a.defaultApi, diff --git a/services/sqlserverflex/client.go b/services/sqlserverflex/client.go index e6c14a7ef..473ddd13b 100644 --- a/services/sqlserverflex/client.go +++ b/services/sqlserverflex/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 sqlserverflex import ( @@ -44,18 +45,21 @@ var ( // APIClient manages communication with the STACKIT MSSQL Service 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/sqlserverflex/configuration.go b/services/sqlserverflex/configuration.go index 17ef65c82..c0b720f4b 100644 --- a/services/sqlserverflex/configuration.go +++ b/services/sqlserverflex/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 sqlserverflex 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/sqlserverflex/go.mod b/services/sqlserverflex/go.mod index 8b64b314c..3e75ba6f7 100644 --- a/services/sqlserverflex/go.mod +++ b/services/sqlserverflex/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/sqlserverflex/go.sum b/services/sqlserverflex/go.sum index ca103c909..195011dd5 100644 --- a/services/sqlserverflex/go.sum +++ b/services/sqlserverflex/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/sqlserverflex/model_acl.go b/services/sqlserverflex/model_acl.go index a108f1cf2..344c8f5e3 100644 --- a/services/sqlserverflex/model_acl.go +++ b/services/sqlserverflex/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 sqlserverflex 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/sqlserverflex/model_backup.go b/services/sqlserverflex/model_backup.go index 22be75bf0..b48ea2778 100644 --- a/services/sqlserverflex/model_backup.go +++ b/services/sqlserverflex/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 sqlserverflex 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/sqlserverflex/model_backup_list_backups_response_grouped.go b/services/sqlserverflex/model_backup_list_backups_response_grouped.go index 56d98832e..fd84b505f 100644 --- a/services/sqlserverflex/model_backup_list_backups_response_grouped.go +++ b/services/sqlserverflex/model_backup_list_backups_response_grouped.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 sqlserverflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &BackupListBackupsResponseGrouped{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupListBackupsResponseGroupedGetBackupsAttributeType = *[]Backup + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupListBackupsResponseGroupedGetBackupsArgType = []Backup + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupListBackupsResponseGroupedGetBackupsRetType = []Backup +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupListBackupsResponseGroupedGetBackupsAttributeTypeOk(arg BackupListBackupsResponseGroupedGetBackupsAttributeType) (ret BackupListBackupsResponseGroupedGetBackupsRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getBackupListBackupsResponseGroupedGetBackupsAttributeTypeOk(arg BackupList return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupListBackupsResponseGroupedGetBackupsAttributeType(arg *BackupListBackupsResponseGroupedGetBackupsAttributeType, val BackupListBackupsResponseGroupedGetBackupsRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setBackupListBackupsResponseGroupedGetBackupsAttributeType(arg *BackupListB */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupListBackupsResponseGroupedGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupListBackupsResponseGroupedGetNameAttributeTypeOk(arg BackupListBackupsResponseGroupedGetNameAttributeType) (ret BackupListBackupsResponseGroupedGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -51,14 +61,19 @@ func getBackupListBackupsResponseGroupedGetNameAttributeTypeOk(arg BackupListBac return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupListBackupsResponseGroupedGetNameAttributeType(arg *BackupListBackupsResponseGroupedGetNameAttributeType, val BackupListBackupsResponseGroupedGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupListBackupsResponseGroupedGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupListBackupsResponseGroupedGetNameRetType = string // BackupListBackupsResponseGrouped struct for BackupListBackupsResponseGrouped +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupListBackupsResponseGrouped struct { Backups BackupListBackupsResponseGroupedGetBackupsAttributeType `json:"backups,omitempty"` Name BackupListBackupsResponseGroupedGetNameAttributeType `json:"name,omitempty"` @@ -68,6 +83,7 @@ type BackupListBackupsResponseGrouped 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 NewBackupListBackupsResponseGrouped() *BackupListBackupsResponseGrouped { this := BackupListBackupsResponseGrouped{} return &this @@ -76,12 +92,14 @@ func NewBackupListBackupsResponseGrouped() *BackupListBackupsResponseGrouped { // NewBackupListBackupsResponseGroupedWithDefaults instantiates a new BackupListBackupsResponseGrouped object // This 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 NewBackupListBackupsResponseGroupedWithDefaults() *BackupListBackupsResponseGrouped { this := BackupListBackupsResponseGrouped{} return &this } // GetBackups returns the Backups field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupListBackupsResponseGrouped) GetBackups() (res BackupListBackupsResponseGroupedGetBackupsRetType) { res, _ = o.GetBackupsOk() return @@ -89,22 +107,26 @@ func (o *BackupListBackupsResponseGrouped) GetBackups() (res BackupListBackupsRe // GetBackupsOk returns a tuple with the Backups field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupListBackupsResponseGrouped) GetBackupsOk() (ret BackupListBackupsResponseGroupedGetBackupsRetType, ok bool) { return getBackupListBackupsResponseGroupedGetBackupsAttributeTypeOk(o.Backups) } // HasBackups returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupListBackupsResponseGrouped) HasBackups() bool { _, ok := o.GetBackupsOk() return ok } // SetBackups gets a reference to the given []Backup and assigns it to the Backups field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupListBackupsResponseGrouped) SetBackups(v BackupListBackupsResponseGroupedGetBackupsRetType) { setBackupListBackupsResponseGroupedGetBackupsAttributeType(&o.Backups, 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 *BackupListBackupsResponseGrouped) GetName() (res BackupListBackupsResponseGroupedGetNameRetType) { res, _ = o.GetNameOk() return @@ -112,21 +134,25 @@ func (o *BackupListBackupsResponseGrouped) GetName() (res BackupListBackupsRespo // 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 *BackupListBackupsResponseGrouped) GetNameOk() (ret BackupListBackupsResponseGroupedGetNameRetType, ok bool) { return getBackupListBackupsResponseGroupedGetNameAttributeTypeOk(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 *BackupListBackupsResponseGrouped) 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 *BackupListBackupsResponseGrouped) SetName(v BackupListBackupsResponseGroupedGetNameRetType) { setBackupListBackupsResponseGroupedGetNameAttributeType(&o.Name, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o BackupListBackupsResponseGrouped) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getBackupListBackupsResponseGroupedGetBackupsAttributeTypeOk(o.Backups); ok { @@ -138,37 +164,45 @@ func (o BackupListBackupsResponseGrouped) 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 NullableBackupListBackupsResponseGrouped struct { value *BackupListBackupsResponseGrouped isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBackupListBackupsResponseGrouped) Get() *BackupListBackupsResponseGrouped { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBackupListBackupsResponseGrouped) Set(val *BackupListBackupsResponseGrouped) { 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 NullableBackupListBackupsResponseGrouped) 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 *NullableBackupListBackupsResponseGrouped) 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 NewNullableBackupListBackupsResponseGrouped(val *BackupListBackupsResponseGrouped) *NullableBackupListBackupsResponseGrouped { return &NullableBackupListBackupsResponseGrouped{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 NullableBackupListBackupsResponseGrouped) 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 *NullableBackupListBackupsResponseGrouped) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/sqlserverflex/model_create_database_payload.go b/services/sqlserverflex/model_create_database_payload.go index 8b1182aa7..f0df0fbe9 100644 --- a/services/sqlserverflex/model_create_database_payload.go +++ b/services/sqlserverflex/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 sqlserverflex 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 */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDatabasePayloadGetOptionsAttributeType = *DatabaseDocumentationCreateDatabaseRequestOptions + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDatabasePayloadGetOptionsArgType = DatabaseDocumentationCreateDatabaseRequestOptions + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDatabasePayloadGetOptionsRetType = DatabaseDocumentationCreateDatabaseRequestOptions +// 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 { // REQUIRED Name CreateDatabasePayloadGetNameAttributeType `json:"name" required:"true"` @@ -66,12 +81,14 @@ type CreateDatabasePayload struct { Options CreateDatabasePayloadGetOptionsAttributeType `json:"options" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _CreateDatabasePayload CreateDatabasePayload // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateDatabasePayload(name CreateDatabasePayloadGetNameArgType, options CreateDatabasePayloadGetOptionsArgType) *CreateDatabasePayload { this := CreateDatabasePayload{} setCreateDatabasePayloadGetNameAttributeType(&this.Name, name) @@ -82,12 +99,14 @@ func NewCreateDatabasePayload(name CreateDatabasePayloadGetNameArgType, options // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDatabasePayload) GetName() (ret CreateDatabasePayloadGetNameRetType) { ret, _ = o.GetNameOk() return ret @@ -95,16 +114,19 @@ func (o *CreateDatabasePayload) GetName() (ret CreateDatabasePayloadGetNameRetTy // 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 *CreateDatabasePayload) GetNameOk() (ret CreateDatabasePayloadGetNameRetType, ok bool) { return getCreateDatabasePayloadGetNameAttributeTypeOk(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 *CreateDatabasePayload) SetName(v CreateDatabasePayloadGetNameRetType) { setCreateDatabasePayloadGetNameAttributeType(&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 *CreateDatabasePayload) GetOptions() (ret CreateDatabasePayloadGetOptionsRetType) { ret, _ = o.GetOptionsOk() return ret @@ -112,15 +134,18 @@ func (o *CreateDatabasePayload) GetOptions() (ret CreateDatabasePayloadGetOption // 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 *CreateDatabasePayload) GetOptionsOk() (ret CreateDatabasePayloadGetOptionsRetType, ok bool) { return getCreateDatabasePayloadGetOptionsAttributeTypeOk(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 *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 { @@ -132,37 +157,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/sqlserverflex/model_create_database_response.go b/services/sqlserverflex/model_create_database_response.go index 493e2a5cc..e88ead67f 100644 --- a/services/sqlserverflex/model_create_database_response.go +++ b/services/sqlserverflex/model_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 sqlserverflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &CreateDatabaseResponse{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDatabaseResponseGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateDatabaseResponseGetIdAttributeTypeOk(arg CreateDatabaseResponseGetIdAttributeType) (ret CreateDatabaseResponseGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -31,14 +34,19 @@ func getCreateDatabaseResponseGetIdAttributeTypeOk(arg CreateDatabaseResponseGet return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateDatabaseResponseGetIdAttributeType(arg *CreateDatabaseResponseGetIdAttributeType, val CreateDatabaseResponseGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDatabaseResponseGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDatabaseResponseGetIdRetType = string // CreateDatabaseResponse struct for CreateDatabaseResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDatabaseResponse struct { Id CreateDatabaseResponseGetIdAttributeType `json:"id,omitempty"` } @@ -47,6 +55,7 @@ type CreateDatabaseResponse 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 NewCreateDatabaseResponse() *CreateDatabaseResponse { this := CreateDatabaseResponse{} return &this @@ -55,12 +64,14 @@ func NewCreateDatabaseResponse() *CreateDatabaseResponse { // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateDatabaseResponseWithDefaults() *CreateDatabaseResponse { this := CreateDatabaseResponse{} 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 *CreateDatabaseResponse) GetId() (res CreateDatabaseResponseGetIdRetType) { res, _ = o.GetIdOk() return @@ -68,21 +79,25 @@ func (o *CreateDatabaseResponse) GetId() (res CreateDatabaseResponseGetIdRetType // 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 *CreateDatabaseResponse) GetIdOk() (ret CreateDatabaseResponseGetIdRetType, ok bool) { return getCreateDatabaseResponseGetIdAttributeTypeOk(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 *CreateDatabaseResponse) 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 *CreateDatabaseResponse) SetId(v CreateDatabaseResponseGetIdRetType) { setCreateDatabaseResponseGetIdAttributeType(&o.Id, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateDatabaseResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateDatabaseResponseGetIdAttributeTypeOk(o.Id); ok { @@ -91,37 +106,45 @@ func (o CreateDatabaseResponse) 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 NullableCreateDatabaseResponse struct { value *CreateDatabaseResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateDatabaseResponse) Get() *CreateDatabaseResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateDatabaseResponse) Set(val *CreateDatabaseResponse) { 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 NullableCreateDatabaseResponse) 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 *NullableCreateDatabaseResponse) 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 NewNullableCreateDatabaseResponse(val *CreateDatabaseResponse) *NullableCreateDatabaseResponse { return &NullableCreateDatabaseResponse{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 NullableCreateDatabaseResponse) 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 *NullableCreateDatabaseResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/sqlserverflex/model_create_instance_payload.go b/services/sqlserverflex/model_create_instance_payload.go index 65e5af1e0..dd899af4e 100644 --- a/services/sqlserverflex/model_create_instance_payload.go +++ b/services/sqlserverflex/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 sqlserverflex 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 = *CreateInstancePayloadAcl + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetAclArgType = CreateInstancePayloadAcl + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetAclRetType = CreateInstancePayloadAcl +// 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 */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetLabelsRetType = map[string]interface{} +// 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 */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetOptionsAttributeType = *CreateInstancePayloadOptions + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetOptionsArgType = CreateInstancePayloadOptions + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetOptionsRetType = CreateInstancePayloadOptions +// 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 */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetStorageAttributeType = *CreateInstancePayloadStorage + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetStorageArgType = CreateInstancePayloadStorage + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetStorageRetType = CreateInstancePayloadStorage +// 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 @@ -156,6 +202,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 } @@ -165,8 +212,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 @@ -174,14 +223,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 { Acl CreateInstancePayloadGetAclAttributeType `json:"acl,omitempty"` // Cronjob for the daily full backup if not provided a job will generated between 00:00 and 04:59 @@ -199,12 +253,14 @@ type CreateInstancePayload struct { Version CreateInstancePayloadGetVersionAttributeType `json:"version,omitempty"` } +// 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(flavorId CreateInstancePayloadGetFlavorIdArgType, name CreateInstancePayloadGetNameArgType) *CreateInstancePayload { this := CreateInstancePayload{} setCreateInstancePayloadGetFlavorIdAttributeType(&this.FlavorId, flavorId) @@ -215,6 +271,7 @@ func NewCreateInstancePayload(flavorId CreateInstancePayloadGetFlavorIdArgType, // 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{} var version string = "2022" @@ -223,6 +280,7 @@ func NewCreateInstancePayloadWithDefaults() *CreateInstancePayload { } // 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 *CreateInstancePayload) GetAcl() (res CreateInstancePayloadGetAclRetType) { res, _ = o.GetAclOk() return @@ -230,22 +288,26 @@ func (o *CreateInstancePayload) GetAcl() (res CreateInstancePayloadGetAclRetType // 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 *CreateInstancePayload) GetAclOk() (ret CreateInstancePayloadGetAclRetType, ok bool) { return getCreateInstancePayloadGetAclAttributeTypeOk(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 *CreateInstancePayload) HasAcl() bool { _, ok := o.GetAclOk() return ok } // SetAcl gets a reference to the given CreateInstancePayloadAcl 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 *CreateInstancePayload) SetAcl(v CreateInstancePayloadGetAclRetType) { setCreateInstancePayloadGetAclAttributeType(&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 *CreateInstancePayload) GetBackupSchedule() (res CreateInstancePayloadGetBackupScheduleRetType) { res, _ = o.GetBackupScheduleOk() return @@ -253,22 +315,26 @@ func (o *CreateInstancePayload) GetBackupSchedule() (res CreateInstancePayloadGe // 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 *CreateInstancePayload) GetBackupScheduleOk() (ret CreateInstancePayloadGetBackupScheduleRetType, ok bool) { return getCreateInstancePayloadGetBackupScheduleAttributeTypeOk(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 *CreateInstancePayload) 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 *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 @@ -276,16 +342,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 @@ -293,22 +362,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]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *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 @@ -316,16 +389,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 if set, 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) GetOptions() (res CreateInstancePayloadGetOptionsRetType) { res, _ = o.GetOptionsOk() return @@ -333,22 +409,26 @@ func (o *CreateInstancePayload) GetOptions() (res CreateInstancePayloadGetOption // 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 *CreateInstancePayload) GetOptionsOk() (ret CreateInstancePayloadGetOptionsRetType, ok bool) { return getCreateInstancePayloadGetOptionsAttributeTypeOk(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 *CreateInstancePayload) HasOptions() bool { _, ok := o.GetOptionsOk() return ok } // SetOptions gets a reference to the given CreateInstancePayloadOptions 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 *CreateInstancePayload) SetOptions(v CreateInstancePayloadGetOptionsRetType) { setCreateInstancePayloadGetOptionsAttributeType(&o.Options, 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 *CreateInstancePayload) GetStorage() (res CreateInstancePayloadGetStorageRetType) { res, _ = o.GetStorageOk() return @@ -356,22 +436,26 @@ func (o *CreateInstancePayload) GetStorage() (res CreateInstancePayloadGetStorag // 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 *CreateInstancePayload) GetStorageOk() (ret CreateInstancePayloadGetStorageRetType, ok bool) { return getCreateInstancePayloadGetStorageAttributeTypeOk(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 *CreateInstancePayload) HasStorage() bool { _, ok := o.GetStorageOk() return ok } // SetStorage gets a reference to the given CreateInstancePayloadStorage 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 *CreateInstancePayload) SetStorage(v CreateInstancePayloadGetStorageRetType) { setCreateInstancePayloadGetStorageAttributeType(&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 *CreateInstancePayload) GetVersion() (res CreateInstancePayloadGetVersionRetType) { res, _ = o.GetVersionOk() return @@ -379,21 +463,25 @@ func (o *CreateInstancePayload) GetVersion() (res CreateInstancePayloadGetVersio // 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 *CreateInstancePayload) GetVersionOk() (ret CreateInstancePayloadGetVersionRetType, ok bool) { return getCreateInstancePayloadGetVersionAttributeTypeOk(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 *CreateInstancePayload) 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 *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 { @@ -423,37 +511,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/sqlserverflex/model_create_instance_payload_acl.go b/services/sqlserverflex/model_create_instance_payload_acl.go index d654de550..ac868304d 100644 --- a/services/sqlserverflex/model_create_instance_payload_acl.go +++ b/services/sqlserverflex/model_create_instance_payload_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 sqlserverflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &CreateInstancePayloadAcl{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadAclGetItemsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadAclGetItemsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadAclGetItemsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateInstancePayloadAclGetItemsAttributeTypeOk(arg CreateInstancePayloadAclGetItemsAttributeType) (ret CreateInstancePayloadAclGetItemsRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getCreateInstancePayloadAclGetItemsAttributeTypeOk(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 setCreateInstancePayloadAclGetItemsAttributeType(arg *CreateInstancePayloadAclGetItemsAttributeType, val CreateInstancePayloadAclGetItemsRetType) { *arg = &val } // CreateInstancePayloadAcl ACL is the Access Control List defining the IP ranges allowed to connect to the database +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadAcl struct { // a simple list with IP addresses with CIDR. Items CreateInstancePayloadAclGetItemsAttributeType `json:"items,omitempty"` @@ -47,6 +56,7 @@ type CreateInstancePayloadAcl 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 NewCreateInstancePayloadAcl() *CreateInstancePayloadAcl { this := CreateInstancePayloadAcl{} return &this @@ -55,12 +65,14 @@ func NewCreateInstancePayloadAcl() *CreateInstancePayloadAcl { // NewCreateInstancePayloadAclWithDefaults instantiates a new CreateInstancePayloadAcl object // This 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 NewCreateInstancePayloadAclWithDefaults() *CreateInstancePayloadAcl { this := CreateInstancePayloadAcl{} 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 *CreateInstancePayloadAcl) GetItems() (res CreateInstancePayloadAclGetItemsRetType) { res, _ = o.GetItemsOk() return @@ -68,21 +80,25 @@ func (o *CreateInstancePayloadAcl) GetItems() (res CreateInstancePayloadAclGetIt // 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 *CreateInstancePayloadAcl) GetItemsOk() (ret CreateInstancePayloadAclGetItemsRetType, ok bool) { return getCreateInstancePayloadAclGetItemsAttributeTypeOk(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 *CreateInstancePayloadAcl) 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 *CreateInstancePayloadAcl) SetItems(v CreateInstancePayloadAclGetItemsRetType) { setCreateInstancePayloadAclGetItemsAttributeType(&o.Items, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateInstancePayloadAcl) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateInstancePayloadAclGetItemsAttributeTypeOk(o.Items); ok { @@ -91,37 +107,45 @@ func (o CreateInstancePayloadAcl) 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 NullableCreateInstancePayloadAcl struct { value *CreateInstancePayloadAcl isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateInstancePayloadAcl) Get() *CreateInstancePayloadAcl { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateInstancePayloadAcl) Set(val *CreateInstancePayloadAcl) { 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 NullableCreateInstancePayloadAcl) 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 *NullableCreateInstancePayloadAcl) 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 NewNullableCreateInstancePayloadAcl(val *CreateInstancePayloadAcl) *NullableCreateInstancePayloadAcl { return &NullableCreateInstancePayloadAcl{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 NullableCreateInstancePayloadAcl) 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 *NullableCreateInstancePayloadAcl) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/sqlserverflex/model_create_instance_payload_options.go b/services/sqlserverflex/model_create_instance_payload_options.go index 84552ba28..1ed3fe7e3 100644 --- a/services/sqlserverflex/model_create_instance_payload_options.go +++ b/services/sqlserverflex/model_create_instance_payload_options.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 sqlserverflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &CreateInstancePayloadOptions{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadOptionsGetEditionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateInstancePayloadOptionsGetEditionAttributeTypeOk(arg CreateInstancePayloadOptionsGetEditionAttributeType) (ret CreateInstancePayloadOptionsGetEditionRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getCreateInstancePayloadOptionsGetEditionAttributeTypeOk(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 setCreateInstancePayloadOptionsGetEditionAttributeType(arg *CreateInstancePayloadOptionsGetEditionAttributeType, val CreateInstancePayloadOptionsGetEditionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadOptionsGetEditionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadOptionsGetEditionRetType = string /* @@ -43,8 +50,10 @@ type CreateInstancePayloadOptionsGetEditionRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadOptionsGetRetentionDaysAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateInstancePayloadOptionsGetRetentionDaysAttributeTypeOk(arg CreateInstancePayloadOptionsGetRetentionDaysAttributeType) (ret CreateInstancePayloadOptionsGetRetentionDaysRetType, ok bool) { if arg == nil { return ret, false @@ -52,14 +61,19 @@ func getCreateInstancePayloadOptionsGetRetentionDaysAttributeTypeOk(arg CreateIn return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateInstancePayloadOptionsGetRetentionDaysAttributeType(arg *CreateInstancePayloadOptionsGetRetentionDaysAttributeType, val CreateInstancePayloadOptionsGetRetentionDaysRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadOptionsGetRetentionDaysArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadOptionsGetRetentionDaysRetType = string // CreateInstancePayloadOptions Database instance specific options are requested via this field +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadOptions struct { // Edition of the MSSQL server instance Edition CreateInstancePayloadOptionsGetEditionAttributeType `json:"edition,omitempty"` @@ -71,6 +85,7 @@ type CreateInstancePayloadOptions 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 NewCreateInstancePayloadOptions() *CreateInstancePayloadOptions { this := CreateInstancePayloadOptions{} return &this @@ -79,6 +94,7 @@ func NewCreateInstancePayloadOptions() *CreateInstancePayloadOptions { // NewCreateInstancePayloadOptionsWithDefaults instantiates a new CreateInstancePayloadOptions object // This 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 NewCreateInstancePayloadOptionsWithDefaults() *CreateInstancePayloadOptions { this := CreateInstancePayloadOptions{} var edition string = "developer" @@ -89,6 +105,7 @@ func NewCreateInstancePayloadOptionsWithDefaults() *CreateInstancePayloadOptions } // GetEdition returns the Edition field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateInstancePayloadOptions) GetEdition() (res CreateInstancePayloadOptionsGetEditionRetType) { res, _ = o.GetEditionOk() return @@ -96,22 +113,26 @@ func (o *CreateInstancePayloadOptions) GetEdition() (res CreateInstancePayloadOp // GetEditionOk returns a tuple with the Edition field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateInstancePayloadOptions) GetEditionOk() (ret CreateInstancePayloadOptionsGetEditionRetType, ok bool) { return getCreateInstancePayloadOptionsGetEditionAttributeTypeOk(o.Edition) } // HasEdition returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateInstancePayloadOptions) HasEdition() bool { _, ok := o.GetEditionOk() return ok } // SetEdition gets a reference to the given string and assigns it to the Edition field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateInstancePayloadOptions) SetEdition(v CreateInstancePayloadOptionsGetEditionRetType) { setCreateInstancePayloadOptionsGetEditionAttributeType(&o.Edition, v) } // GetRetentionDays returns the RetentionDays field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateInstancePayloadOptions) GetRetentionDays() (res CreateInstancePayloadOptionsGetRetentionDaysRetType) { res, _ = o.GetRetentionDaysOk() return @@ -119,21 +140,25 @@ func (o *CreateInstancePayloadOptions) GetRetentionDays() (res CreateInstancePay // GetRetentionDaysOk returns a tuple with the RetentionDays field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateInstancePayloadOptions) GetRetentionDaysOk() (ret CreateInstancePayloadOptionsGetRetentionDaysRetType, ok bool) { return getCreateInstancePayloadOptionsGetRetentionDaysAttributeTypeOk(o.RetentionDays) } // HasRetentionDays returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateInstancePayloadOptions) HasRetentionDays() bool { _, ok := o.GetRetentionDaysOk() return ok } // SetRetentionDays gets a reference to the given string and assigns it to the RetentionDays field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateInstancePayloadOptions) SetRetentionDays(v CreateInstancePayloadOptionsGetRetentionDaysRetType) { setCreateInstancePayloadOptionsGetRetentionDaysAttributeType(&o.RetentionDays, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateInstancePayloadOptions) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateInstancePayloadOptionsGetEditionAttributeTypeOk(o.Edition); ok { @@ -145,37 +170,45 @@ func (o CreateInstancePayloadOptions) 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 NullableCreateInstancePayloadOptions struct { value *CreateInstancePayloadOptions isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateInstancePayloadOptions) Get() *CreateInstancePayloadOptions { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateInstancePayloadOptions) Set(val *CreateInstancePayloadOptions) { 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 NullableCreateInstancePayloadOptions) 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 *NullableCreateInstancePayloadOptions) 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 NewNullableCreateInstancePayloadOptions(val *CreateInstancePayloadOptions) *NullableCreateInstancePayloadOptions { return &NullableCreateInstancePayloadOptions{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 NullableCreateInstancePayloadOptions) 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 *NullableCreateInstancePayloadOptions) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/sqlserverflex/model_create_instance_payload_storage.go b/services/sqlserverflex/model_create_instance_payload_storage.go index 857c57031..b7b9f3ae4 100644 --- a/services/sqlserverflex/model_create_instance_payload_storage.go +++ b/services/sqlserverflex/model_create_instance_payload_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 sqlserverflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &CreateInstancePayloadStorage{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadStorageGetClassAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateInstancePayloadStorageGetClassAttributeTypeOk(arg CreateInstancePayloadStorageGetClassAttributeType) (ret CreateInstancePayloadStorageGetClassRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getCreateInstancePayloadStorageGetClassAttributeTypeOk(arg CreateInstancePa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateInstancePayloadStorageGetClassAttributeType(arg *CreateInstancePayloadStorageGetClassAttributeType, val CreateInstancePayloadStorageGetClassRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadStorageGetClassArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadStorageGetClassRetType = string /* @@ -43,10 +50,16 @@ type CreateInstancePayloadStorageGetClassRetType = string */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadStorageGetSizeAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadStorageGetSizeArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadStorageGetSizeRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateInstancePayloadStorageGetSizeAttributeTypeOk(arg CreateInstancePayloadStorageGetSizeAttributeType) (ret CreateInstancePayloadStorageGetSizeRetType, ok bool) { if arg == nil { return ret, false @@ -54,11 +67,13 @@ func getCreateInstancePayloadStorageGetSizeAttributeTypeOk(arg CreateInstancePay return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateInstancePayloadStorageGetSizeAttributeType(arg *CreateInstancePayloadStorageGetSizeAttributeType, val CreateInstancePayloadStorageGetSizeRetType) { *arg = &val } // CreateInstancePayloadStorage Storage for the instance +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadStorage struct { // Class of the instance. Class CreateInstancePayloadStorageGetClassAttributeType `json:"class,omitempty"` @@ -70,6 +85,7 @@ type CreateInstancePayloadStorage 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 NewCreateInstancePayloadStorage() *CreateInstancePayloadStorage { this := CreateInstancePayloadStorage{} return &this @@ -78,6 +94,7 @@ func NewCreateInstancePayloadStorage() *CreateInstancePayloadStorage { // NewCreateInstancePayloadStorageWithDefaults instantiates a new CreateInstancePayloadStorage object // This 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 NewCreateInstancePayloadStorageWithDefaults() *CreateInstancePayloadStorage { this := CreateInstancePayloadStorage{} var class string = "premium-perf12-stackit" @@ -86,6 +103,7 @@ func NewCreateInstancePayloadStorageWithDefaults() *CreateInstancePayloadStorage } // 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 *CreateInstancePayloadStorage) GetClass() (res CreateInstancePayloadStorageGetClassRetType) { res, _ = o.GetClassOk() return @@ -93,22 +111,26 @@ func (o *CreateInstancePayloadStorage) GetClass() (res CreateInstancePayloadStor // 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 *CreateInstancePayloadStorage) GetClassOk() (ret CreateInstancePayloadStorageGetClassRetType, ok bool) { return getCreateInstancePayloadStorageGetClassAttributeTypeOk(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 *CreateInstancePayloadStorage) 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 *CreateInstancePayloadStorage) SetClass(v CreateInstancePayloadStorageGetClassRetType) { setCreateInstancePayloadStorageGetClassAttributeType(&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 *CreateInstancePayloadStorage) GetSize() (res CreateInstancePayloadStorageGetSizeRetType) { res, _ = o.GetSizeOk() return @@ -116,21 +138,25 @@ func (o *CreateInstancePayloadStorage) GetSize() (res CreateInstancePayloadStora // 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 *CreateInstancePayloadStorage) GetSizeOk() (ret CreateInstancePayloadStorageGetSizeRetType, ok bool) { return getCreateInstancePayloadStorageGetSizeAttributeTypeOk(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 *CreateInstancePayloadStorage) 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 *CreateInstancePayloadStorage) SetSize(v CreateInstancePayloadStorageGetSizeRetType) { setCreateInstancePayloadStorageGetSizeAttributeType(&o.Size, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateInstancePayloadStorage) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateInstancePayloadStorageGetClassAttributeTypeOk(o.Class); ok { @@ -142,37 +168,45 @@ func (o CreateInstancePayloadStorage) 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 NullableCreateInstancePayloadStorage struct { value *CreateInstancePayloadStorage isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateInstancePayloadStorage) Get() *CreateInstancePayloadStorage { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateInstancePayloadStorage) Set(val *CreateInstancePayloadStorage) { 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 NullableCreateInstancePayloadStorage) 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 *NullableCreateInstancePayloadStorage) 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 NewNullableCreateInstancePayloadStorage(val *CreateInstancePayloadStorage) *NullableCreateInstancePayloadStorage { return &NullableCreateInstancePayloadStorage{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 NullableCreateInstancePayloadStorage) 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 *NullableCreateInstancePayloadStorage) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/sqlserverflex/model_create_instance_response.go b/services/sqlserverflex/model_create_instance_response.go index 3c6b77391..cea48eeee 100644 --- a/services/sqlserverflex/model_create_instance_response.go +++ b/services/sqlserverflex/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 sqlserverflex 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/sqlserverflex/model_create_user_payload.go b/services/sqlserverflex/model_create_user_payload.go index 04d3fb3f5..31d353597 100644 --- a/services/sqlserverflex/model_create_user_payload.go +++ b/services/sqlserverflex/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 sqlserverflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &CreateUserPayload{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateUserPayloadGetDefaultDatabaseAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateUserPayloadGetDefaultDatabaseAttributeTypeOk(arg CreateUserPayloadGetDefaultDatabaseAttributeType) (ret CreateUserPayloadGetDefaultDatabaseRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getCreateUserPayloadGetDefaultDatabaseAttributeTypeOk(arg CreateUserPayload return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateUserPayloadGetDefaultDatabaseAttributeType(arg *CreateUserPayloadGetDefaultDatabaseAttributeType, val CreateUserPayloadGetDefaultDatabaseRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateUserPayloadGetDefaultDatabaseArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateUserPayloadGetDefaultDatabaseRetType = string /* @@ -43,10 +50,16 @@ type CreateUserPayloadGetDefaultDatabaseRetType = string */ // 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 @@ -54,6 +67,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 } @@ -63,8 +77,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 @@ -72,14 +88,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 { DefaultDatabase CreateUserPayloadGetDefaultDatabaseAttributeType `json:"default_database,omitempty"` // REQUIRED @@ -88,12 +109,14 @@ type CreateUserPayload struct { Username CreateUserPayloadGetUsernameAttributeType `json:"username" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _CreateUserPayload CreateUserPayload // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateUserPayload(roles CreateUserPayloadGetRolesArgType, username CreateUserPayloadGetUsernameArgType) *CreateUserPayload { this := CreateUserPayload{} setCreateUserPayloadGetRolesAttributeType(&this.Roles, roles) @@ -104,12 +127,14 @@ func NewCreateUserPayload(roles CreateUserPayloadGetRolesArgType, username Creat // 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 } // GetDefaultDatabase returns the DefaultDatabase field value if set, 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) GetDefaultDatabase() (res CreateUserPayloadGetDefaultDatabaseRetType) { res, _ = o.GetDefaultDatabaseOk() return @@ -117,22 +142,26 @@ func (o *CreateUserPayload) GetDefaultDatabase() (res CreateUserPayloadGetDefaul // GetDefaultDatabaseOk returns a tuple with the DefaultDatabase field value if set, nil otherwise // and a boolean to check if the value 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) GetDefaultDatabaseOk() (ret CreateUserPayloadGetDefaultDatabaseRetType, ok bool) { return getCreateUserPayloadGetDefaultDatabaseAttributeTypeOk(o.DefaultDatabase) } // HasDefaultDatabase returns a boolean if a field 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) HasDefaultDatabase() bool { _, ok := o.GetDefaultDatabaseOk() return ok } // SetDefaultDatabase gets a reference to the given string and assigns it to the DefaultDatabase field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateUserPayload) SetDefaultDatabase(v CreateUserPayloadGetDefaultDatabaseRetType) { setCreateUserPayloadGetDefaultDatabaseAttributeType(&o.DefaultDatabase, v) } // GetRoles returns the Roles field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateUserPayload) GetRoles() (ret CreateUserPayloadGetRolesRetType) { ret, _ = o.GetRolesOk() return ret @@ -140,16 +169,19 @@ func (o *CreateUserPayload) GetRoles() (ret CreateUserPayloadGetRolesRetType) { // GetRolesOk returns a tuple with the Roles 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 *CreateUserPayload) GetRolesOk() (ret CreateUserPayloadGetRolesRetType, ok bool) { return getCreateUserPayloadGetRolesAttributeTypeOk(o.Roles) } // SetRoles sets field value +// 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateUserPayload) GetUsername() (ret CreateUserPayloadGetUsernameRetType) { ret, _ = o.GetUsernameOk() return ret @@ -157,15 +189,18 @@ func (o *CreateUserPayload) GetUsername() (ret CreateUserPayloadGetUsernameRetTy // GetUsernameOk returns a tuple with the Username 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 *CreateUserPayload) GetUsernameOk() (ret CreateUserPayloadGetUsernameRetType, ok bool) { return getCreateUserPayloadGetUsernameAttributeTypeOk(o.Username) } // SetUsername sets field value +// 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 := getCreateUserPayloadGetDefaultDatabaseAttributeTypeOk(o.DefaultDatabase); ok { @@ -180,37 +215,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/sqlserverflex/model_create_user_response.go b/services/sqlserverflex/model_create_user_response.go index d5f21ae61..f558e27fb 100644 --- a/services/sqlserverflex/model_create_user_response.go +++ b/services/sqlserverflex/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 sqlserverflex 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 = *SingleUser + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateUserResponseGetItemArgType = SingleUser + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateUserResponseGetItemRetType = SingleUser +// 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 SingleUser 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/sqlserverflex/model_data_point.go b/services/sqlserverflex/model_data_point.go index e230e5575..415ee80e1 100644 --- a/services/sqlserverflex/model_data_point.go +++ b/services/sqlserverflex/model_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 sqlserverflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &DataPoint{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DataPointGetTimestampAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDataPointGetTimestampAttributeTypeOk(arg DataPointGetTimestampAttributeType) (ret DataPointGetTimestampRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getDataPointGetTimestampAttributeTypeOk(arg DataPointGetTimestampAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDataPointGetTimestampAttributeType(arg *DataPointGetTimestampAttributeType, val DataPointGetTimestampRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DataPointGetTimestampArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DataPointGetTimestampRetType = string /* @@ -43,10 +50,16 @@ type DataPointGetTimestampRetType = string */ // isNumber +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DataPointGetValueAttributeType = *float64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DataPointGetValueArgType = float64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DataPointGetValueRetType = float64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDataPointGetValueAttributeTypeOk(arg DataPointGetValueAttributeType) (ret DataPointGetValueRetType, ok bool) { if arg == nil { return ret, false @@ -54,11 +67,13 @@ func getDataPointGetValueAttributeTypeOk(arg DataPointGetValueAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDataPointGetValueAttributeType(arg *DataPointGetValueAttributeType, val DataPointGetValueRetType) { *arg = &val } // DataPoint struct for DataPoint +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DataPoint struct { Timestamp DataPointGetTimestampAttributeType `json:"timestamp,omitempty"` Value DataPointGetValueAttributeType `json:"value,omitempty"` @@ -68,6 +83,7 @@ type DataPoint 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 NewDataPoint() *DataPoint { this := DataPoint{} return &this @@ -76,12 +92,14 @@ func NewDataPoint() *DataPoint { // NewDataPointWithDefaults instantiates a new DataPoint object // This 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 NewDataPointWithDefaults() *DataPoint { this := DataPoint{} 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 *DataPoint) GetTimestamp() (res DataPointGetTimestampRetType) { res, _ = o.GetTimestampOk() return @@ -89,22 +107,26 @@ func (o *DataPoint) GetTimestamp() (res DataPointGetTimestampRetType) { // 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 *DataPoint) GetTimestampOk() (ret DataPointGetTimestampRetType, ok bool) { return getDataPointGetTimestampAttributeTypeOk(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 *DataPoint) 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 *DataPoint) SetTimestamp(v DataPointGetTimestampRetType) { setDataPointGetTimestampAttributeType(&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 *DataPoint) GetValue() (res DataPointGetValueRetType) { res, _ = o.GetValueOk() return @@ -112,21 +134,25 @@ func (o *DataPoint) GetValue() (res DataPointGetValueRetType) { // 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 *DataPoint) GetValueOk() (ret DataPointGetValueRetType, ok bool) { return getDataPointGetValueAttributeTypeOk(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 *DataPoint) 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 *DataPoint) SetValue(v DataPointGetValueRetType) { setDataPointGetValueAttributeType(&o.Value, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o DataPoint) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getDataPointGetTimestampAttributeTypeOk(o.Timestamp); ok { @@ -138,37 +164,45 @@ func (o DataPoint) 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 NullableDataPoint struct { value *DataPoint isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDataPoint) Get() *DataPoint { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDataPoint) Set(val *DataPoint) { 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 NullableDataPoint) 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 *NullableDataPoint) 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 NewNullableDataPoint(val *DataPoint) *NullableDataPoint { return &NullableDataPoint{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 NullableDataPoint) 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 *NullableDataPoint) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/sqlserverflex/model_database.go b/services/sqlserverflex/model_database.go index 1ade6bddf..651d505f4 100644 --- a/services/sqlserverflex/model_database.go +++ b/services/sqlserverflex/model_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 sqlserverflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &Database{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DatabaseGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDatabaseGetIdAttributeTypeOk(arg DatabaseGetIdAttributeType) (ret DatabaseGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getDatabaseGetIdAttributeTypeOk(arg DatabaseGetIdAttributeType) (ret Databa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDatabaseGetIdAttributeType(arg *DatabaseGetIdAttributeType, val DatabaseGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DatabaseGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DatabaseGetIdRetType = string /* @@ -43,8 +50,10 @@ type DatabaseGetIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DatabaseGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDatabaseGetNameAttributeTypeOk(arg DatabaseGetNameAttributeType) (ret DatabaseGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -52,11 +61,15 @@ func getDatabaseGetNameAttributeTypeOk(arg DatabaseGetNameAttributeType) (ret Da return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDatabaseGetNameAttributeType(arg *DatabaseGetNameAttributeType, val DatabaseGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DatabaseGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DatabaseGetNameRetType = string /* @@ -64,10 +77,16 @@ type DatabaseGetNameRetType = string */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DatabaseGetOptionsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DatabaseGetOptionsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DatabaseGetOptionsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDatabaseGetOptionsAttributeTypeOk(arg DatabaseGetOptionsAttributeType) (ret DatabaseGetOptionsRetType, ok bool) { if arg == nil { return ret, false @@ -75,11 +94,13 @@ func getDatabaseGetOptionsAttributeTypeOk(arg DatabaseGetOptionsAttributeType) ( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDatabaseGetOptionsAttributeType(arg *DatabaseGetOptionsAttributeType, val DatabaseGetOptionsRetType) { *arg = &val } // Database struct for Database +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Database struct { Id DatabaseGetIdAttributeType `json:"id,omitempty"` Name DatabaseGetNameAttributeType `json:"name,omitempty"` @@ -91,6 +112,7 @@ type Database 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 NewDatabase() *Database { this := Database{} return &this @@ -99,12 +121,14 @@ func NewDatabase() *Database { // NewDatabaseWithDefaults instantiates a new Database object // This 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 NewDatabaseWithDefaults() *Database { this := Database{} 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 *Database) GetId() (res DatabaseGetIdRetType) { res, _ = o.GetIdOk() return @@ -112,22 +136,26 @@ func (o *Database) GetId() (res DatabaseGetIdRetType) { // 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 *Database) GetIdOk() (ret DatabaseGetIdRetType, ok bool) { return getDatabaseGetIdAttributeTypeOk(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 *Database) 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 *Database) SetId(v DatabaseGetIdRetType) { setDatabaseGetIdAttributeType(&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 *Database) GetName() (res DatabaseGetNameRetType) { res, _ = o.GetNameOk() return @@ -135,22 +163,26 @@ func (o *Database) GetName() (res DatabaseGetNameRetType) { // 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 *Database) GetNameOk() (ret DatabaseGetNameRetType, ok bool) { return getDatabaseGetNameAttributeTypeOk(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 *Database) 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 *Database) SetName(v DatabaseGetNameRetType) { setDatabaseGetNameAttributeType(&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 *Database) GetOptions() (res DatabaseGetOptionsRetType) { res, _ = o.GetOptionsOk() return @@ -158,21 +190,25 @@ func (o *Database) GetOptions() (res DatabaseGetOptionsRetType) { // 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 *Database) GetOptionsOk() (ret DatabaseGetOptionsRetType, ok bool) { return getDatabaseGetOptionsAttributeTypeOk(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 *Database) 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 *Database) SetOptions(v DatabaseGetOptionsRetType) { setDatabaseGetOptionsAttributeType(&o.Options, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o Database) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getDatabaseGetIdAttributeTypeOk(o.Id); ok { @@ -187,37 +223,45 @@ func (o Database) 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 NullableDatabase struct { value *Database isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDatabase) Get() *Database { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDatabase) Set(val *Database) { 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 NullableDatabase) 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 *NullableDatabase) 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 NewNullableDatabase(val *Database) *NullableDatabase { return &NullableDatabase{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 NullableDatabase) 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 *NullableDatabase) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/sqlserverflex/model_database_documentation_create_database_request_options.go b/services/sqlserverflex/model_database_documentation_create_database_request_options.go index b46729cb8..117d749cf 100644 --- a/services/sqlserverflex/model_database_documentation_create_database_request_options.go +++ b/services/sqlserverflex/model_database_documentation_create_database_request_options.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 sqlserverflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &DatabaseDocumentationCreateDatabaseRequestOptions{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DatabaseDocumentationCreateDatabaseRequestOptionsGetCollationAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDatabaseDocumentationCreateDatabaseRequestOptionsGetCollationAttributeTypeOk(arg DatabaseDocumentationCreateDatabaseRequestOptionsGetCollationAttributeType) (ret DatabaseDocumentationCreateDatabaseRequestOptionsGetCollationRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getDatabaseDocumentationCreateDatabaseRequestOptionsGetCollationAttributeTy return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDatabaseDocumentationCreateDatabaseRequestOptionsGetCollationAttributeType(arg *DatabaseDocumentationCreateDatabaseRequestOptionsGetCollationAttributeType, val DatabaseDocumentationCreateDatabaseRequestOptionsGetCollationRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DatabaseDocumentationCreateDatabaseRequestOptionsGetCollationArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DatabaseDocumentationCreateDatabaseRequestOptionsGetCollationRetType = string /* @@ -43,8 +50,10 @@ type DatabaseDocumentationCreateDatabaseRequestOptionsGetCollationRetType = stri */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DatabaseDocumentationCreateDatabaseRequestOptionsGetCompatibilityLevelAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDatabaseDocumentationCreateDatabaseRequestOptionsGetCompatibilityLevelAttributeTypeOk(arg DatabaseDocumentationCreateDatabaseRequestOptionsGetCompatibilityLevelAttributeType) (ret DatabaseDocumentationCreateDatabaseRequestOptionsGetCompatibilityLevelRetType, ok bool) { if arg == nil { return ret, false @@ -52,11 +61,15 @@ func getDatabaseDocumentationCreateDatabaseRequestOptionsGetCompatibilityLevelAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDatabaseDocumentationCreateDatabaseRequestOptionsGetCompatibilityLevelAttributeType(arg *DatabaseDocumentationCreateDatabaseRequestOptionsGetCompatibilityLevelAttributeType, val DatabaseDocumentationCreateDatabaseRequestOptionsGetCompatibilityLevelRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DatabaseDocumentationCreateDatabaseRequestOptionsGetCompatibilityLevelArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DatabaseDocumentationCreateDatabaseRequestOptionsGetCompatibilityLevelRetType = string /* @@ -64,8 +77,10 @@ type DatabaseDocumentationCreateDatabaseRequestOptionsGetCompatibilityLevelRetTy */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DatabaseDocumentationCreateDatabaseRequestOptionsGetOwnerAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDatabaseDocumentationCreateDatabaseRequestOptionsGetOwnerAttributeTypeOk(arg DatabaseDocumentationCreateDatabaseRequestOptionsGetOwnerAttributeType) (ret DatabaseDocumentationCreateDatabaseRequestOptionsGetOwnerRetType, ok bool) { if arg == nil { return ret, false @@ -73,14 +88,19 @@ func getDatabaseDocumentationCreateDatabaseRequestOptionsGetOwnerAttributeTypeOk return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDatabaseDocumentationCreateDatabaseRequestOptionsGetOwnerAttributeType(arg *DatabaseDocumentationCreateDatabaseRequestOptionsGetOwnerAttributeType, val DatabaseDocumentationCreateDatabaseRequestOptionsGetOwnerRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DatabaseDocumentationCreateDatabaseRequestOptionsGetOwnerArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DatabaseDocumentationCreateDatabaseRequestOptionsGetOwnerRetType = string // DatabaseDocumentationCreateDatabaseRequestOptions struct for DatabaseDocumentationCreateDatabaseRequestOptions +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DatabaseDocumentationCreateDatabaseRequestOptions struct { // Collation of the database Collation DatabaseDocumentationCreateDatabaseRequestOptionsGetCollationAttributeType `json:"collation,omitempty"` @@ -91,12 +111,14 @@ type DatabaseDocumentationCreateDatabaseRequestOptions struct { Owner DatabaseDocumentationCreateDatabaseRequestOptionsGetOwnerAttributeType `json:"owner" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _DatabaseDocumentationCreateDatabaseRequestOptions DatabaseDocumentationCreateDatabaseRequestOptions // NewDatabaseDocumentationCreateDatabaseRequestOptions instantiates a new DatabaseDocumentationCreateDatabaseRequestOptions object // This constructor will assign default values to properties that have it defined, // 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 NewDatabaseDocumentationCreateDatabaseRequestOptions(owner DatabaseDocumentationCreateDatabaseRequestOptionsGetOwnerArgType) *DatabaseDocumentationCreateDatabaseRequestOptions { this := DatabaseDocumentationCreateDatabaseRequestOptions{} setDatabaseDocumentationCreateDatabaseRequestOptionsGetOwnerAttributeType(&this.Owner, owner) @@ -106,12 +128,14 @@ func NewDatabaseDocumentationCreateDatabaseRequestOptions(owner DatabaseDocument // NewDatabaseDocumentationCreateDatabaseRequestOptionsWithDefaults instantiates a new DatabaseDocumentationCreateDatabaseRequestOptions object // This 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 NewDatabaseDocumentationCreateDatabaseRequestOptionsWithDefaults() *DatabaseDocumentationCreateDatabaseRequestOptions { this := DatabaseDocumentationCreateDatabaseRequestOptions{} return &this } // GetCollation returns the Collation field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DatabaseDocumentationCreateDatabaseRequestOptions) GetCollation() (res DatabaseDocumentationCreateDatabaseRequestOptionsGetCollationRetType) { res, _ = o.GetCollationOk() return @@ -119,22 +143,26 @@ func (o *DatabaseDocumentationCreateDatabaseRequestOptions) GetCollation() (res // GetCollationOk returns a tuple with the Collation field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DatabaseDocumentationCreateDatabaseRequestOptions) GetCollationOk() (ret DatabaseDocumentationCreateDatabaseRequestOptionsGetCollationRetType, ok bool) { return getDatabaseDocumentationCreateDatabaseRequestOptionsGetCollationAttributeTypeOk(o.Collation) } // HasCollation returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DatabaseDocumentationCreateDatabaseRequestOptions) HasCollation() bool { _, ok := o.GetCollationOk() return ok } // SetCollation gets a reference to the given string and assigns it to the Collation field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DatabaseDocumentationCreateDatabaseRequestOptions) SetCollation(v DatabaseDocumentationCreateDatabaseRequestOptionsGetCollationRetType) { setDatabaseDocumentationCreateDatabaseRequestOptionsGetCollationAttributeType(&o.Collation, v) } // GetCompatibilityLevel returns the CompatibilityLevel field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DatabaseDocumentationCreateDatabaseRequestOptions) GetCompatibilityLevel() (res DatabaseDocumentationCreateDatabaseRequestOptionsGetCompatibilityLevelRetType) { res, _ = o.GetCompatibilityLevelOk() return @@ -142,22 +170,26 @@ func (o *DatabaseDocumentationCreateDatabaseRequestOptions) GetCompatibilityLeve // GetCompatibilityLevelOk returns a tuple with the CompatibilityLevel field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DatabaseDocumentationCreateDatabaseRequestOptions) GetCompatibilityLevelOk() (ret DatabaseDocumentationCreateDatabaseRequestOptionsGetCompatibilityLevelRetType, ok bool) { return getDatabaseDocumentationCreateDatabaseRequestOptionsGetCompatibilityLevelAttributeTypeOk(o.CompatibilityLevel) } // HasCompatibilityLevel returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DatabaseDocumentationCreateDatabaseRequestOptions) HasCompatibilityLevel() bool { _, ok := o.GetCompatibilityLevelOk() return ok } // SetCompatibilityLevel gets a reference to the given string and assigns it to the CompatibilityLevel field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DatabaseDocumentationCreateDatabaseRequestOptions) SetCompatibilityLevel(v DatabaseDocumentationCreateDatabaseRequestOptionsGetCompatibilityLevelRetType) { setDatabaseDocumentationCreateDatabaseRequestOptionsGetCompatibilityLevelAttributeType(&o.CompatibilityLevel, v) } // GetOwner returns the Owner field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DatabaseDocumentationCreateDatabaseRequestOptions) GetOwner() (ret DatabaseDocumentationCreateDatabaseRequestOptionsGetOwnerRetType) { ret, _ = o.GetOwnerOk() return ret @@ -165,15 +197,18 @@ func (o *DatabaseDocumentationCreateDatabaseRequestOptions) GetOwner() (ret Data // GetOwnerOk returns a tuple with the Owner 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 *DatabaseDocumentationCreateDatabaseRequestOptions) GetOwnerOk() (ret DatabaseDocumentationCreateDatabaseRequestOptionsGetOwnerRetType, ok bool) { return getDatabaseDocumentationCreateDatabaseRequestOptionsGetOwnerAttributeTypeOk(o.Owner) } // SetOwner sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DatabaseDocumentationCreateDatabaseRequestOptions) SetOwner(v DatabaseDocumentationCreateDatabaseRequestOptionsGetOwnerRetType) { setDatabaseDocumentationCreateDatabaseRequestOptionsGetOwnerAttributeType(&o.Owner, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o DatabaseDocumentationCreateDatabaseRequestOptions) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getDatabaseDocumentationCreateDatabaseRequestOptionsGetCollationAttributeTypeOk(o.Collation); ok { @@ -188,37 +223,45 @@ func (o DatabaseDocumentationCreateDatabaseRequestOptions) ToMap() (map[string]i return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableDatabaseDocumentationCreateDatabaseRequestOptions struct { value *DatabaseDocumentationCreateDatabaseRequestOptions isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDatabaseDocumentationCreateDatabaseRequestOptions) Get() *DatabaseDocumentationCreateDatabaseRequestOptions { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDatabaseDocumentationCreateDatabaseRequestOptions) Set(val *DatabaseDocumentationCreateDatabaseRequestOptions) { 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 NullableDatabaseDocumentationCreateDatabaseRequestOptions) 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 *NullableDatabaseDocumentationCreateDatabaseRequestOptions) 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 NewNullableDatabaseDocumentationCreateDatabaseRequestOptions(val *DatabaseDocumentationCreateDatabaseRequestOptions) *NullableDatabaseDocumentationCreateDatabaseRequestOptions { return &NullableDatabaseDocumentationCreateDatabaseRequestOptions{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 NullableDatabaseDocumentationCreateDatabaseRequestOptions) 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 *NullableDatabaseDocumentationCreateDatabaseRequestOptions) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/sqlserverflex/model_database_options.go b/services/sqlserverflex/model_database_options.go index cdaabe608..ae779defa 100644 --- a/services/sqlserverflex/model_database_options.go +++ b/services/sqlserverflex/model_database_options.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 sqlserverflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &DatabaseOptions{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DatabaseOptionsGetCollationNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDatabaseOptionsGetCollationNameAttributeTypeOk(arg DatabaseOptionsGetCollationNameAttributeType) (ret DatabaseOptionsGetCollationNameRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getDatabaseOptionsGetCollationNameAttributeTypeOk(arg DatabaseOptionsGetCol return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDatabaseOptionsGetCollationNameAttributeType(arg *DatabaseOptionsGetCollationNameAttributeType, val DatabaseOptionsGetCollationNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DatabaseOptionsGetCollationNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DatabaseOptionsGetCollationNameRetType = string /* @@ -43,10 +50,16 @@ type DatabaseOptionsGetCollationNameRetType = string */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DatabaseOptionsGetCompatibilityLevelAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DatabaseOptionsGetCompatibilityLevelArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DatabaseOptionsGetCompatibilityLevelRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDatabaseOptionsGetCompatibilityLevelAttributeTypeOk(arg DatabaseOptionsGetCompatibilityLevelAttributeType) (ret DatabaseOptionsGetCompatibilityLevelRetType, ok bool) { if arg == nil { return ret, false @@ -54,6 +67,7 @@ func getDatabaseOptionsGetCompatibilityLevelAttributeTypeOk(arg DatabaseOptionsG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDatabaseOptionsGetCompatibilityLevelAttributeType(arg *DatabaseOptionsGetCompatibilityLevelAttributeType, val DatabaseOptionsGetCompatibilityLevelRetType) { *arg = &val } @@ -63,8 +77,10 @@ func setDatabaseOptionsGetCompatibilityLevelAttributeType(arg *DatabaseOptionsGe */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DatabaseOptionsGetOwnerAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDatabaseOptionsGetOwnerAttributeTypeOk(arg DatabaseOptionsGetOwnerAttributeType) (ret DatabaseOptionsGetOwnerRetType, ok bool) { if arg == nil { return ret, false @@ -72,14 +88,19 @@ func getDatabaseOptionsGetOwnerAttributeTypeOk(arg DatabaseOptionsGetOwnerAttrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDatabaseOptionsGetOwnerAttributeType(arg *DatabaseOptionsGetOwnerAttributeType, val DatabaseOptionsGetOwnerRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DatabaseOptionsGetOwnerArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DatabaseOptionsGetOwnerRetType = string // DatabaseOptions struct for DatabaseOptions +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DatabaseOptions struct { // Name of the collation of the database CollationName DatabaseOptionsGetCollationNameAttributeType `json:"collationName,omitempty"` @@ -93,6 +114,7 @@ type DatabaseOptions 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 NewDatabaseOptions() *DatabaseOptions { this := DatabaseOptions{} return &this @@ -101,12 +123,14 @@ func NewDatabaseOptions() *DatabaseOptions { // NewDatabaseOptionsWithDefaults instantiates a new DatabaseOptions object // This 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 NewDatabaseOptionsWithDefaults() *DatabaseOptions { this := DatabaseOptions{} return &this } // GetCollationName returns the CollationName field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DatabaseOptions) GetCollationName() (res DatabaseOptionsGetCollationNameRetType) { res, _ = o.GetCollationNameOk() return @@ -114,22 +138,26 @@ func (o *DatabaseOptions) GetCollationName() (res DatabaseOptionsGetCollationNam // GetCollationNameOk returns a tuple with the CollationName field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DatabaseOptions) GetCollationNameOk() (ret DatabaseOptionsGetCollationNameRetType, ok bool) { return getDatabaseOptionsGetCollationNameAttributeTypeOk(o.CollationName) } // HasCollationName returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DatabaseOptions) HasCollationName() bool { _, ok := o.GetCollationNameOk() return ok } // SetCollationName gets a reference to the given string and assigns it to the CollationName field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DatabaseOptions) SetCollationName(v DatabaseOptionsGetCollationNameRetType) { setDatabaseOptionsGetCollationNameAttributeType(&o.CollationName, v) } // GetCompatibilityLevel returns the CompatibilityLevel field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DatabaseOptions) GetCompatibilityLevel() (res DatabaseOptionsGetCompatibilityLevelRetType) { res, _ = o.GetCompatibilityLevelOk() return @@ -137,22 +165,26 @@ func (o *DatabaseOptions) GetCompatibilityLevel() (res DatabaseOptionsGetCompati // GetCompatibilityLevelOk returns a tuple with the CompatibilityLevel field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DatabaseOptions) GetCompatibilityLevelOk() (ret DatabaseOptionsGetCompatibilityLevelRetType, ok bool) { return getDatabaseOptionsGetCompatibilityLevelAttributeTypeOk(o.CompatibilityLevel) } // HasCompatibilityLevel returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DatabaseOptions) HasCompatibilityLevel() bool { _, ok := o.GetCompatibilityLevelOk() return ok } // SetCompatibilityLevel gets a reference to the given int64 and assigns it to the CompatibilityLevel field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DatabaseOptions) SetCompatibilityLevel(v DatabaseOptionsGetCompatibilityLevelRetType) { setDatabaseOptionsGetCompatibilityLevelAttributeType(&o.CompatibilityLevel, v) } // GetOwner returns the Owner field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DatabaseOptions) GetOwner() (res DatabaseOptionsGetOwnerRetType) { res, _ = o.GetOwnerOk() return @@ -160,21 +192,25 @@ func (o *DatabaseOptions) GetOwner() (res DatabaseOptionsGetOwnerRetType) { // GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DatabaseOptions) GetOwnerOk() (ret DatabaseOptionsGetOwnerRetType, ok bool) { return getDatabaseOptionsGetOwnerAttributeTypeOk(o.Owner) } // HasOwner returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DatabaseOptions) HasOwner() bool { _, ok := o.GetOwnerOk() return ok } // SetOwner gets a reference to the given string and assigns it to the Owner field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DatabaseOptions) SetOwner(v DatabaseOptionsGetOwnerRetType) { setDatabaseOptionsGetOwnerAttributeType(&o.Owner, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o DatabaseOptions) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getDatabaseOptionsGetCollationNameAttributeTypeOk(o.CollationName); ok { @@ -189,37 +225,45 @@ func (o DatabaseOptions) 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 NullableDatabaseOptions struct { value *DatabaseOptions isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDatabaseOptions) Get() *DatabaseOptions { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDatabaseOptions) Set(val *DatabaseOptions) { 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 NullableDatabaseOptions) 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 *NullableDatabaseOptions) 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 NewNullableDatabaseOptions(val *DatabaseOptions) *NullableDatabaseOptions { return &NullableDatabaseOptions{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 NullableDatabaseOptions) 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 *NullableDatabaseOptions) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/sqlserverflex/model_flavor.go b/services/sqlserverflex/model_flavor.go index a568df4d6..b2847f706 100644 --- a/services/sqlserverflex/model_flavor.go +++ b/services/sqlserverflex/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 sqlserverflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &Flavor{} */ // isInteger +// 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 */ // isInteger +// 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 { // Can be cast to int32 without loss of precision. Cpu FlavorGetCpuAttributeType `json:"cpu,omitempty"` @@ -113,6 +141,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 @@ -121,12 +150,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 @@ -134,22 +165,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 @@ -157,22 +192,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 @@ -180,22 +219,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 @@ -203,21 +246,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 { @@ -235,37 +282,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/sqlserverflex/model_get_backup_response.go b/services/sqlserverflex/model_get_backup_response.go index 86ae27193..fe1df8979 100644 --- a/services/sqlserverflex/model_get_backup_response.go +++ b/services/sqlserverflex/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 sqlserverflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &GetBackupResponse{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupResponseGetEndTimeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetBackupResponseGetEndTimeAttributeTypeOk(arg GetBackupResponseGetEndTimeAttributeType) (ret GetBackupResponseGetEndTimeRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getGetBackupResponseGetEndTimeAttributeTypeOk(arg GetBackupResponseGetEndTi return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetBackupResponseGetEndTimeAttributeType(arg *GetBackupResponseGetEndTimeAttributeType, val GetBackupResponseGetEndTimeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupResponseGetEndTimeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupResponseGetEndTimeRetType = string /* @@ -43,8 +50,10 @@ type GetBackupResponseGetEndTimeRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupResponseGetErrorAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetBackupResponseGetErrorAttributeTypeOk(arg GetBackupResponseGetErrorAttributeType) (ret GetBackupResponseGetErrorRetType, ok bool) { if arg == nil { return ret, false @@ -52,11 +61,15 @@ func getGetBackupResponseGetErrorAttributeTypeOk(arg GetBackupResponseGetErrorAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetBackupResponseGetErrorAttributeType(arg *GetBackupResponseGetErrorAttributeType, val GetBackupResponseGetErrorRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupResponseGetErrorArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupResponseGetErrorRetType = string /* @@ -64,8 +77,10 @@ type GetBackupResponseGetErrorRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupResponseGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetBackupResponseGetIdAttributeTypeOk(arg GetBackupResponseGetIdAttributeType) (ret GetBackupResponseGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -73,11 +88,15 @@ func getGetBackupResponseGetIdAttributeTypeOk(arg GetBackupResponseGetIdAttribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetBackupResponseGetIdAttributeType(arg *GetBackupResponseGetIdAttributeType, val GetBackupResponseGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupResponseGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupResponseGetIdRetType = string /* @@ -85,10 +104,16 @@ type GetBackupResponseGetIdRetType = string */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupResponseGetLabelsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupResponseGetLabelsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupResponseGetLabelsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetBackupResponseGetLabelsAttributeTypeOk(arg GetBackupResponseGetLabelsAttributeType) (ret GetBackupResponseGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -96,6 +121,7 @@ func getGetBackupResponseGetLabelsAttributeTypeOk(arg GetBackupResponseGetLabels return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetBackupResponseGetLabelsAttributeType(arg *GetBackupResponseGetLabelsAttributeType, val GetBackupResponseGetLabelsRetType) { *arg = &val } @@ -105,8 +131,10 @@ func setGetBackupResponseGetLabelsAttributeType(arg *GetBackupResponseGetLabelsA */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupResponseGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetBackupResponseGetNameAttributeTypeOk(arg GetBackupResponseGetNameAttributeType) (ret GetBackupResponseGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -114,11 +142,15 @@ func getGetBackupResponseGetNameAttributeTypeOk(arg GetBackupResponseGetNameAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetBackupResponseGetNameAttributeType(arg *GetBackupResponseGetNameAttributeType, val GetBackupResponseGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupResponseGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupResponseGetNameRetType = string /* @@ -126,10 +158,16 @@ type GetBackupResponseGetNameRetType = string */ // isContainer +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupResponseGetOptionsAttributeType = *map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupResponseGetOptionsArgType = map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupResponseGetOptionsRetType = map[string]string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetBackupResponseGetOptionsAttributeTypeOk(arg GetBackupResponseGetOptionsAttributeType) (ret GetBackupResponseGetOptionsRetType, ok bool) { if arg == nil { return ret, false @@ -137,6 +175,7 @@ func getGetBackupResponseGetOptionsAttributeTypeOk(arg GetBackupResponseGetOptio return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetBackupResponseGetOptionsAttributeType(arg *GetBackupResponseGetOptionsAttributeType, val GetBackupResponseGetOptionsRetType) { *arg = &val } @@ -146,10 +185,16 @@ func setGetBackupResponseGetOptionsAttributeType(arg *GetBackupResponseGetOption */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupResponseGetSizeAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupResponseGetSizeArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupResponseGetSizeRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetBackupResponseGetSizeAttributeTypeOk(arg GetBackupResponseGetSizeAttributeType) (ret GetBackupResponseGetSizeRetType, ok bool) { if arg == nil { return ret, false @@ -157,6 +202,7 @@ func getGetBackupResponseGetSizeAttributeTypeOk(arg GetBackupResponseGetSizeAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetBackupResponseGetSizeAttributeType(arg *GetBackupResponseGetSizeAttributeType, val GetBackupResponseGetSizeRetType) { *arg = &val } @@ -166,8 +212,10 @@ func setGetBackupResponseGetSizeAttributeType(arg *GetBackupResponseGetSizeAttri */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupResponseGetStartTimeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetBackupResponseGetStartTimeAttributeTypeOk(arg GetBackupResponseGetStartTimeAttributeType) (ret GetBackupResponseGetStartTimeRetType, ok bool) { if arg == nil { return ret, false @@ -175,14 +223,19 @@ func getGetBackupResponseGetStartTimeAttributeTypeOk(arg GetBackupResponseGetSta return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetBackupResponseGetStartTimeAttributeType(arg *GetBackupResponseGetStartTimeAttributeType, val GetBackupResponseGetStartTimeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupResponseGetStartTimeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupResponseGetStartTimeRetType = string // 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 { // Backup end time represents local server time EndTime GetBackupResponseGetEndTimeAttributeType `json:"endTime,omitempty"` @@ -206,6 +259,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 @@ -214,12 +268,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 } // 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 *GetBackupResponse) GetEndTime() (res GetBackupResponseGetEndTimeRetType) { res, _ = o.GetEndTimeOk() return @@ -227,22 +283,26 @@ func (o *GetBackupResponse) GetEndTime() (res GetBackupResponseGetEndTimeRetType // 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 *GetBackupResponse) GetEndTimeOk() (ret GetBackupResponseGetEndTimeRetType, ok bool) { return getGetBackupResponseGetEndTimeAttributeTypeOk(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 *GetBackupResponse) 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 *GetBackupResponse) SetEndTime(v GetBackupResponseGetEndTimeRetType) { setGetBackupResponseGetEndTimeAttributeType(&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 *GetBackupResponse) GetError() (res GetBackupResponseGetErrorRetType) { res, _ = o.GetErrorOk() return @@ -250,22 +310,26 @@ func (o *GetBackupResponse) GetError() (res GetBackupResponseGetErrorRetType) { // 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 *GetBackupResponse) GetErrorOk() (ret GetBackupResponseGetErrorRetType, ok bool) { return getGetBackupResponseGetErrorAttributeTypeOk(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 *GetBackupResponse) 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 *GetBackupResponse) SetError(v GetBackupResponseGetErrorRetType) { setGetBackupResponseGetErrorAttributeType(&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 *GetBackupResponse) GetId() (res GetBackupResponseGetIdRetType) { res, _ = o.GetIdOk() return @@ -273,22 +337,26 @@ func (o *GetBackupResponse) GetId() (res GetBackupResponseGetIdRetType) { // 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 *GetBackupResponse) GetIdOk() (ret GetBackupResponseGetIdRetType, ok bool) { return getGetBackupResponseGetIdAttributeTypeOk(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 *GetBackupResponse) 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 *GetBackupResponse) SetId(v GetBackupResponseGetIdRetType) { setGetBackupResponseGetIdAttributeType(&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 *GetBackupResponse) GetLabels() (res GetBackupResponseGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -296,22 +364,26 @@ func (o *GetBackupResponse) GetLabels() (res GetBackupResponseGetLabelsRetType) // 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 *GetBackupResponse) GetLabelsOk() (ret GetBackupResponseGetLabelsRetType, ok bool) { return getGetBackupResponseGetLabelsAttributeTypeOk(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 *GetBackupResponse) 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 *GetBackupResponse) SetLabels(v GetBackupResponseGetLabelsRetType) { setGetBackupResponseGetLabelsAttributeType(&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 *GetBackupResponse) GetName() (res GetBackupResponseGetNameRetType) { res, _ = o.GetNameOk() return @@ -319,22 +391,26 @@ func (o *GetBackupResponse) GetName() (res GetBackupResponseGetNameRetType) { // 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 *GetBackupResponse) GetNameOk() (ret GetBackupResponseGetNameRetType, ok bool) { return getGetBackupResponseGetNameAttributeTypeOk(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 *GetBackupResponse) 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 *GetBackupResponse) SetName(v GetBackupResponseGetNameRetType) { setGetBackupResponseGetNameAttributeType(&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 *GetBackupResponse) GetOptions() (res GetBackupResponseGetOptionsRetType) { res, _ = o.GetOptionsOk() return @@ -342,22 +418,26 @@ func (o *GetBackupResponse) GetOptions() (res GetBackupResponseGetOptionsRetType // 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 *GetBackupResponse) GetOptionsOk() (ret GetBackupResponseGetOptionsRetType, ok bool) { return getGetBackupResponseGetOptionsAttributeTypeOk(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 *GetBackupResponse) 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 *GetBackupResponse) SetOptions(v GetBackupResponseGetOptionsRetType) { setGetBackupResponseGetOptionsAttributeType(&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 *GetBackupResponse) GetSize() (res GetBackupResponseGetSizeRetType) { res, _ = o.GetSizeOk() return @@ -365,22 +445,26 @@ func (o *GetBackupResponse) GetSize() (res GetBackupResponseGetSizeRetType) { // 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 *GetBackupResponse) GetSizeOk() (ret GetBackupResponseGetSizeRetType, ok bool) { return getGetBackupResponseGetSizeAttributeTypeOk(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 *GetBackupResponse) 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 *GetBackupResponse) SetSize(v GetBackupResponseGetSizeRetType) { setGetBackupResponseGetSizeAttributeType(&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 *GetBackupResponse) GetStartTime() (res GetBackupResponseGetStartTimeRetType) { res, _ = o.GetStartTimeOk() return @@ -388,21 +472,25 @@ func (o *GetBackupResponse) GetStartTime() (res GetBackupResponseGetStartTimeRet // 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 *GetBackupResponse) GetStartTimeOk() (ret GetBackupResponseGetStartTimeRetType, ok bool) { return getGetBackupResponseGetStartTimeAttributeTypeOk(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 *GetBackupResponse) 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 *GetBackupResponse) SetStartTime(v GetBackupResponseGetStartTimeRetType) { setGetBackupResponseGetStartTimeAttributeType(&o.StartTime, 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 := getGetBackupResponseGetEndTimeAttributeTypeOk(o.EndTime); ok { @@ -432,37 +520,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/sqlserverflex/model_get_database_response.go b/services/sqlserverflex/model_get_database_response.go index f9fae45a4..1e5f5d531 100644 --- a/services/sqlserverflex/model_get_database_response.go +++ b/services/sqlserverflex/model_get_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 sqlserverflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &GetDatabaseResponse{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetDatabaseResponseGetDatabaseAttributeType = *SingleDatabase + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetDatabaseResponseGetDatabaseArgType = SingleDatabase + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetDatabaseResponseGetDatabaseRetType = SingleDatabase +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetDatabaseResponseGetDatabaseAttributeTypeOk(arg GetDatabaseResponseGetDatabaseAttributeType) (ret GetDatabaseResponseGetDatabaseRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getGetDatabaseResponseGetDatabaseAttributeTypeOk(arg GetDatabaseResponseGet return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetDatabaseResponseGetDatabaseAttributeType(arg *GetDatabaseResponseGetDatabaseAttributeType, val GetDatabaseResponseGetDatabaseRetType) { *arg = &val } // GetDatabaseResponse struct for GetDatabaseResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetDatabaseResponse struct { Database GetDatabaseResponseGetDatabaseAttributeType `json:"database,omitempty"` } @@ -46,6 +55,7 @@ type GetDatabaseResponse 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 NewGetDatabaseResponse() *GetDatabaseResponse { this := GetDatabaseResponse{} return &this @@ -54,12 +64,14 @@ func NewGetDatabaseResponse() *GetDatabaseResponse { // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewGetDatabaseResponseWithDefaults() *GetDatabaseResponse { this := GetDatabaseResponse{} 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 *GetDatabaseResponse) GetDatabase() (res GetDatabaseResponseGetDatabaseRetType) { res, _ = o.GetDatabaseOk() return @@ -67,21 +79,25 @@ func (o *GetDatabaseResponse) GetDatabase() (res GetDatabaseResponseGetDatabaseR // 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 *GetDatabaseResponse) GetDatabaseOk() (ret GetDatabaseResponseGetDatabaseRetType, ok bool) { return getGetDatabaseResponseGetDatabaseAttributeTypeOk(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 *GetDatabaseResponse) HasDatabase() bool { _, ok := o.GetDatabaseOk() return ok } // SetDatabase gets a reference to the given SingleDatabase 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 *GetDatabaseResponse) SetDatabase(v GetDatabaseResponseGetDatabaseRetType) { setGetDatabaseResponseGetDatabaseAttributeType(&o.Database, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o GetDatabaseResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getGetDatabaseResponseGetDatabaseAttributeTypeOk(o.Database); ok { @@ -90,37 +106,45 @@ func (o GetDatabaseResponse) 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 NullableGetDatabaseResponse struct { value *GetDatabaseResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetDatabaseResponse) Get() *GetDatabaseResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetDatabaseResponse) Set(val *GetDatabaseResponse) { 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 NullableGetDatabaseResponse) 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 *NullableGetDatabaseResponse) 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 NewNullableGetDatabaseResponse(val *GetDatabaseResponse) *NullableGetDatabaseResponse { return &NullableGetDatabaseResponse{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 NullableGetDatabaseResponse) 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 *NullableGetDatabaseResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/sqlserverflex/model_get_instance_response.go b/services/sqlserverflex/model_get_instance_response.go index 062b8ed21..28b6e3d2b 100644 --- a/services/sqlserverflex/model_get_instance_response.go +++ b/services/sqlserverflex/model_get_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 sqlserverflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &GetInstanceResponse{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetInstanceResponseGetItemAttributeType = *Instance + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetInstanceResponseGetItemArgType = Instance + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetInstanceResponseGetItemRetType = Instance +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetInstanceResponseGetItemAttributeTypeOk(arg GetInstanceResponseGetItemAttributeType) (ret GetInstanceResponseGetItemRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getGetInstanceResponseGetItemAttributeTypeOk(arg GetInstanceResponseGetItem return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetInstanceResponseGetItemAttributeType(arg *GetInstanceResponseGetItemAttributeType, val GetInstanceResponseGetItemRetType) { *arg = &val } // GetInstanceResponse struct for GetInstanceResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetInstanceResponse struct { Item GetInstanceResponseGetItemAttributeType `json:"item,omitempty"` } @@ -46,6 +55,7 @@ type GetInstanceResponse 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 NewGetInstanceResponse() *GetInstanceResponse { this := GetInstanceResponse{} return &this @@ -54,12 +64,14 @@ func NewGetInstanceResponse() *GetInstanceResponse { // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewGetInstanceResponseWithDefaults() *GetInstanceResponse { this := GetInstanceResponse{} 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 *GetInstanceResponse) GetItem() (res GetInstanceResponseGetItemRetType) { res, _ = o.GetItemOk() return @@ -67,21 +79,25 @@ func (o *GetInstanceResponse) GetItem() (res GetInstanceResponseGetItemRetType) // 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 *GetInstanceResponse) GetItemOk() (ret GetInstanceResponseGetItemRetType, ok bool) { return getGetInstanceResponseGetItemAttributeTypeOk(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 *GetInstanceResponse) 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 *GetInstanceResponse) SetItem(v GetInstanceResponseGetItemRetType) { setGetInstanceResponseGetItemAttributeType(&o.Item, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o GetInstanceResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getGetInstanceResponseGetItemAttributeTypeOk(o.Item); ok { @@ -90,37 +106,45 @@ func (o GetInstanceResponse) 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 NullableGetInstanceResponse struct { value *GetInstanceResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetInstanceResponse) Get() *GetInstanceResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetInstanceResponse) Set(val *GetInstanceResponse) { 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 NullableGetInstanceResponse) 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 *NullableGetInstanceResponse) 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 NewNullableGetInstanceResponse(val *GetInstanceResponse) *NullableGetInstanceResponse { return &NullableGetInstanceResponse{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 NullableGetInstanceResponse) 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 *NullableGetInstanceResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/sqlserverflex/model_get_user_response.go b/services/sqlserverflex/model_get_user_response.go index 3f8a26906..551ff6c2b 100644 --- a/services/sqlserverflex/model_get_user_response.go +++ b/services/sqlserverflex/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 sqlserverflex 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 = *UserResponseUser + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetUserResponseGetItemArgType = UserResponseUser + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetUserResponseGetItemRetType = UserResponseUser +// 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 UserResponseUser 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/sqlserverflex/model_host.go b/services/sqlserverflex/model_host.go index 2183fe5cf..09378fcae 100644 --- a/services/sqlserverflex/model_host.go +++ b/services/sqlserverflex/model_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 sqlserverflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &Host{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HostGetHostMetricsAttributeType = *[]HostMetric + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HostGetHostMetricsArgType = []HostMetric + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HostGetHostMetricsRetType = []HostMetric +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getHostGetHostMetricsAttributeTypeOk(arg HostGetHostMetricsAttributeType) (ret HostGetHostMetricsRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getHostGetHostMetricsAttributeTypeOk(arg HostGetHostMetricsAttributeType) ( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setHostGetHostMetricsAttributeType(arg *HostGetHostMetricsAttributeType, val HostGetHostMetricsRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setHostGetHostMetricsAttributeType(arg *HostGetHostMetricsAttributeType, va */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HostGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getHostGetIdAttributeTypeOk(arg HostGetIdAttributeType) (ret HostGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -51,14 +61,19 @@ func getHostGetIdAttributeTypeOk(arg HostGetIdAttributeType) (ret HostGetIdRetTy return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setHostGetIdAttributeType(arg *HostGetIdAttributeType, val HostGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HostGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HostGetIdRetType = string // Host struct for Host +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Host struct { HostMetrics HostGetHostMetricsAttributeType `json:"hostMetrics,omitempty"` Id HostGetIdAttributeType `json:"id,omitempty"` @@ -68,6 +83,7 @@ type Host 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 NewHost() *Host { this := Host{} return &this @@ -76,12 +92,14 @@ func NewHost() *Host { // NewHostWithDefaults instantiates a new Host object // This 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 NewHostWithDefaults() *Host { this := Host{} 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 *Host) GetHostMetrics() (res HostGetHostMetricsRetType) { res, _ = o.GetHostMetricsOk() return @@ -89,22 +107,26 @@ func (o *Host) GetHostMetrics() (res HostGetHostMetricsRetType) { // 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 *Host) GetHostMetricsOk() (ret HostGetHostMetricsRetType, ok bool) { return getHostGetHostMetricsAttributeTypeOk(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 *Host) HasHostMetrics() bool { _, ok := o.GetHostMetricsOk() return ok } // SetHostMetrics gets a reference to the given []HostMetric 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 *Host) SetHostMetrics(v HostGetHostMetricsRetType) { setHostGetHostMetricsAttributeType(&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 *Host) GetId() (res HostGetIdRetType) { res, _ = o.GetIdOk() return @@ -112,21 +134,25 @@ func (o *Host) GetId() (res HostGetIdRetType) { // 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 *Host) GetIdOk() (ret HostGetIdRetType, ok bool) { return getHostGetIdAttributeTypeOk(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 *Host) 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 *Host) SetId(v HostGetIdRetType) { setHostGetIdAttributeType(&o.Id, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o Host) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getHostGetHostMetricsAttributeTypeOk(o.HostMetrics); ok { @@ -138,37 +164,45 @@ func (o Host) 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 NullableHost struct { value *Host isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableHost) Get() *Host { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableHost) Set(val *Host) { 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 NullableHost) 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 *NullableHost) 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 NewNullableHost(val *Host) *NullableHost { return &NullableHost{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 NullableHost) 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 *NullableHost) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/sqlserverflex/model_host_metric.go b/services/sqlserverflex/model_host_metric.go index d15e09415..5bfb61b31 100644 --- a/services/sqlserverflex/model_host_metric.go +++ b/services/sqlserverflex/model_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 sqlserverflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &HostMetric{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HostMetricGetDatapointsAttributeType = *[]DataPoint + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HostMetricGetDatapointsArgType = []DataPoint + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HostMetricGetDatapointsRetType = []DataPoint +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getHostMetricGetDatapointsAttributeTypeOk(arg HostMetricGetDatapointsAttributeType) (ret HostMetricGetDatapointsRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getHostMetricGetDatapointsAttributeTypeOk(arg HostMetricGetDatapointsAttrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setHostMetricGetDatapointsAttributeType(arg *HostMetricGetDatapointsAttributeType, val HostMetricGetDatapointsRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setHostMetricGetDatapointsAttributeType(arg *HostMetricGetDatapointsAttribu */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HostMetricGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getHostMetricGetNameAttributeTypeOk(arg HostMetricGetNameAttributeType) (ret HostMetricGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -51,11 +61,15 @@ func getHostMetricGetNameAttributeTypeOk(arg HostMetricGetNameAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setHostMetricGetNameAttributeType(arg *HostMetricGetNameAttributeType, val HostMetricGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HostMetricGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HostMetricGetNameRetType = string /* @@ -63,8 +77,10 @@ type HostMetricGetNameRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HostMetricGetUnitsAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getHostMetricGetUnitsAttributeTypeOk(arg HostMetricGetUnitsAttributeType) (ret HostMetricGetUnitsRetType, ok bool) { if arg == nil { return ret, false @@ -72,14 +88,19 @@ func getHostMetricGetUnitsAttributeTypeOk(arg HostMetricGetUnitsAttributeType) ( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setHostMetricGetUnitsAttributeType(arg *HostMetricGetUnitsAttributeType, val HostMetricGetUnitsRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HostMetricGetUnitsArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HostMetricGetUnitsRetType = string // HostMetric struct for HostMetric +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HostMetric struct { Datapoints HostMetricGetDatapointsAttributeType `json:"datapoints,omitempty"` Name HostMetricGetNameAttributeType `json:"name,omitempty"` @@ -90,6 +111,7 @@ type HostMetric 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 NewHostMetric() *HostMetric { this := HostMetric{} return &this @@ -98,12 +120,14 @@ func NewHostMetric() *HostMetric { // NewHostMetricWithDefaults instantiates a new HostMetric object // This 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 NewHostMetricWithDefaults() *HostMetric { this := HostMetric{} 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 *HostMetric) GetDatapoints() (res HostMetricGetDatapointsRetType) { res, _ = o.GetDatapointsOk() return @@ -111,22 +135,26 @@ func (o *HostMetric) GetDatapoints() (res HostMetricGetDatapointsRetType) { // 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 *HostMetric) GetDatapointsOk() (ret HostMetricGetDatapointsRetType, ok bool) { return getHostMetricGetDatapointsAttributeTypeOk(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 *HostMetric) HasDatapoints() bool { _, ok := o.GetDatapointsOk() return ok } // SetDatapoints gets a reference to the given []DataPoint 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 *HostMetric) SetDatapoints(v HostMetricGetDatapointsRetType) { setHostMetricGetDatapointsAttributeType(&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 *HostMetric) GetName() (res HostMetricGetNameRetType) { res, _ = o.GetNameOk() return @@ -134,22 +162,26 @@ func (o *HostMetric) GetName() (res HostMetricGetNameRetType) { // 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 *HostMetric) GetNameOk() (ret HostMetricGetNameRetType, ok bool) { return getHostMetricGetNameAttributeTypeOk(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 *HostMetric) 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 *HostMetric) SetName(v HostMetricGetNameRetType) { setHostMetricGetNameAttributeType(&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 *HostMetric) GetUnits() (res HostMetricGetUnitsRetType) { res, _ = o.GetUnitsOk() return @@ -157,21 +189,25 @@ func (o *HostMetric) GetUnits() (res HostMetricGetUnitsRetType) { // 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 *HostMetric) GetUnitsOk() (ret HostMetricGetUnitsRetType, ok bool) { return getHostMetricGetUnitsAttributeTypeOk(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 *HostMetric) 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 *HostMetric) SetUnits(v HostMetricGetUnitsRetType) { setHostMetricGetUnitsAttributeType(&o.Units, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o HostMetric) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getHostMetricGetDatapointsAttributeTypeOk(o.Datapoints); ok { @@ -186,37 +222,45 @@ func (o HostMetric) 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 NullableHostMetric struct { value *HostMetric isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableHostMetric) Get() *HostMetric { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableHostMetric) Set(val *HostMetric) { 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 NullableHostMetric) 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 *NullableHostMetric) 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 NewNullableHostMetric(val *HostMetric) *NullableHostMetric { return &NullableHostMetric{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 NullableHostMetric) 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 *NullableHostMetric) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/sqlserverflex/model_instance.go b/services/sqlserverflex/model_instance.go index 61dcdfddc..1d6957920 100644 --- a/services/sqlserverflex/model_instance.go +++ b/services/sqlserverflex/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 sqlserverflex 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/sqlserverflex/model_instance_documentation_acl.go b/services/sqlserverflex/model_instance_documentation_acl.go index 2206a0278..7704ac6dc 100644 --- a/services/sqlserverflex/model_instance_documentation_acl.go +++ b/services/sqlserverflex/model_instance_documentation_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 sqlserverflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &InstanceDocumentationACL{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceDocumentationACLGetItemsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceDocumentationACLGetItemsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceDocumentationACLGetItemsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceDocumentationACLGetItemsAttributeTypeOk(arg InstanceDocumentationACLGetItemsAttributeType) (ret InstanceDocumentationACLGetItemsRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getInstanceDocumentationACLGetItemsAttributeTypeOk(arg InstanceDocumentatio return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceDocumentationACLGetItemsAttributeType(arg *InstanceDocumentationACLGetItemsAttributeType, val InstanceDocumentationACLGetItemsRetType) { *arg = &val } // InstanceDocumentationACL struct for InstanceDocumentationACL +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceDocumentationACL struct { // a simple list with IP addresses with CIDR. Items InstanceDocumentationACLGetItemsAttributeType `json:"items,omitempty"` @@ -47,6 +56,7 @@ type InstanceDocumentationACL 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 NewInstanceDocumentationACL() *InstanceDocumentationACL { this := InstanceDocumentationACL{} return &this @@ -55,12 +65,14 @@ func NewInstanceDocumentationACL() *InstanceDocumentationACL { // NewInstanceDocumentationACLWithDefaults instantiates a new InstanceDocumentationACL object // This 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 NewInstanceDocumentationACLWithDefaults() *InstanceDocumentationACL { this := InstanceDocumentationACL{} 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 *InstanceDocumentationACL) GetItems() (res InstanceDocumentationACLGetItemsRetType) { res, _ = o.GetItemsOk() return @@ -68,21 +80,25 @@ func (o *InstanceDocumentationACL) GetItems() (res InstanceDocumentationACLGetIt // 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 *InstanceDocumentationACL) GetItemsOk() (ret InstanceDocumentationACLGetItemsRetType, ok bool) { return getInstanceDocumentationACLGetItemsAttributeTypeOk(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 *InstanceDocumentationACL) 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 *InstanceDocumentationACL) SetItems(v InstanceDocumentationACLGetItemsRetType) { setInstanceDocumentationACLGetItemsAttributeType(&o.Items, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o InstanceDocumentationACL) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getInstanceDocumentationACLGetItemsAttributeTypeOk(o.Items); ok { @@ -91,37 +107,45 @@ func (o InstanceDocumentationACL) 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 NullableInstanceDocumentationACL struct { value *InstanceDocumentationACL isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInstanceDocumentationACL) Get() *InstanceDocumentationACL { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInstanceDocumentationACL) Set(val *InstanceDocumentationACL) { 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 NullableInstanceDocumentationACL) 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 *NullableInstanceDocumentationACL) 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 NewNullableInstanceDocumentationACL(val *InstanceDocumentationACL) *NullableInstanceDocumentationACL { return &NullableInstanceDocumentationACL{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 NullableInstanceDocumentationACL) 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 *NullableInstanceDocumentationACL) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/sqlserverflex/model_instance_documentation_options.go b/services/sqlserverflex/model_instance_documentation_options.go index 1cbaec3a9..cc807af1e 100644 --- a/services/sqlserverflex/model_instance_documentation_options.go +++ b/services/sqlserverflex/model_instance_documentation_options.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 sqlserverflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &InstanceDocumentationOptions{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceDocumentationOptionsGetEditionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceDocumentationOptionsGetEditionAttributeTypeOk(arg InstanceDocumentationOptionsGetEditionAttributeType) (ret InstanceDocumentationOptionsGetEditionRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getInstanceDocumentationOptionsGetEditionAttributeTypeOk(arg InstanceDocume return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceDocumentationOptionsGetEditionAttributeType(arg *InstanceDocumentationOptionsGetEditionAttributeType, val InstanceDocumentationOptionsGetEditionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceDocumentationOptionsGetEditionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceDocumentationOptionsGetEditionRetType = string /* @@ -43,8 +50,10 @@ type InstanceDocumentationOptionsGetEditionRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceDocumentationOptionsGetRetentionDaysAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceDocumentationOptionsGetRetentionDaysAttributeTypeOk(arg InstanceDocumentationOptionsGetRetentionDaysAttributeType) (ret InstanceDocumentationOptionsGetRetentionDaysRetType, ok bool) { if arg == nil { return ret, false @@ -52,14 +61,19 @@ func getInstanceDocumentationOptionsGetRetentionDaysAttributeTypeOk(arg Instance return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceDocumentationOptionsGetRetentionDaysAttributeType(arg *InstanceDocumentationOptionsGetRetentionDaysAttributeType, val InstanceDocumentationOptionsGetRetentionDaysRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceDocumentationOptionsGetRetentionDaysArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceDocumentationOptionsGetRetentionDaysRetType = string // InstanceDocumentationOptions struct for InstanceDocumentationOptions +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceDocumentationOptions struct { // Edition of the MSSQL server instance Edition InstanceDocumentationOptionsGetEditionAttributeType `json:"edition,omitempty"` @@ -71,6 +85,7 @@ type InstanceDocumentationOptions 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 NewInstanceDocumentationOptions() *InstanceDocumentationOptions { this := InstanceDocumentationOptions{} return &this @@ -79,6 +94,7 @@ func NewInstanceDocumentationOptions() *InstanceDocumentationOptions { // NewInstanceDocumentationOptionsWithDefaults instantiates a new InstanceDocumentationOptions object // This 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 NewInstanceDocumentationOptionsWithDefaults() *InstanceDocumentationOptions { this := InstanceDocumentationOptions{} var edition string = "developer" @@ -89,6 +105,7 @@ func NewInstanceDocumentationOptionsWithDefaults() *InstanceDocumentationOptions } // GetEdition returns the Edition field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceDocumentationOptions) GetEdition() (res InstanceDocumentationOptionsGetEditionRetType) { res, _ = o.GetEditionOk() return @@ -96,22 +113,26 @@ func (o *InstanceDocumentationOptions) GetEdition() (res InstanceDocumentationOp // GetEditionOk returns a tuple with the Edition field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceDocumentationOptions) GetEditionOk() (ret InstanceDocumentationOptionsGetEditionRetType, ok bool) { return getInstanceDocumentationOptionsGetEditionAttributeTypeOk(o.Edition) } // HasEdition returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceDocumentationOptions) HasEdition() bool { _, ok := o.GetEditionOk() return ok } // SetEdition gets a reference to the given string and assigns it to the Edition field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceDocumentationOptions) SetEdition(v InstanceDocumentationOptionsGetEditionRetType) { setInstanceDocumentationOptionsGetEditionAttributeType(&o.Edition, v) } // GetRetentionDays returns the RetentionDays field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceDocumentationOptions) GetRetentionDays() (res InstanceDocumentationOptionsGetRetentionDaysRetType) { res, _ = o.GetRetentionDaysOk() return @@ -119,21 +140,25 @@ func (o *InstanceDocumentationOptions) GetRetentionDays() (res InstanceDocumenta // GetRetentionDaysOk returns a tuple with the RetentionDays field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceDocumentationOptions) GetRetentionDaysOk() (ret InstanceDocumentationOptionsGetRetentionDaysRetType, ok bool) { return getInstanceDocumentationOptionsGetRetentionDaysAttributeTypeOk(o.RetentionDays) } // HasRetentionDays returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceDocumentationOptions) HasRetentionDays() bool { _, ok := o.GetRetentionDaysOk() return ok } // SetRetentionDays gets a reference to the given string and assigns it to the RetentionDays field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceDocumentationOptions) SetRetentionDays(v InstanceDocumentationOptionsGetRetentionDaysRetType) { setInstanceDocumentationOptionsGetRetentionDaysAttributeType(&o.RetentionDays, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o InstanceDocumentationOptions) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getInstanceDocumentationOptionsGetEditionAttributeTypeOk(o.Edition); ok { @@ -145,37 +170,45 @@ func (o InstanceDocumentationOptions) 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 NullableInstanceDocumentationOptions struct { value *InstanceDocumentationOptions isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInstanceDocumentationOptions) Get() *InstanceDocumentationOptions { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInstanceDocumentationOptions) Set(val *InstanceDocumentationOptions) { 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 NullableInstanceDocumentationOptions) 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 *NullableInstanceDocumentationOptions) 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 NewNullableInstanceDocumentationOptions(val *InstanceDocumentationOptions) *NullableInstanceDocumentationOptions { return &NullableInstanceDocumentationOptions{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 NullableInstanceDocumentationOptions) 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 *NullableInstanceDocumentationOptions) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/sqlserverflex/model_instance_documentation_storage.go b/services/sqlserverflex/model_instance_documentation_storage.go index 7d679a6c6..039ef8a15 100644 --- a/services/sqlserverflex/model_instance_documentation_storage.go +++ b/services/sqlserverflex/model_instance_documentation_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 sqlserverflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &InstanceDocumentationStorage{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceDocumentationStorageGetClassAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceDocumentationStorageGetClassAttributeTypeOk(arg InstanceDocumentationStorageGetClassAttributeType) (ret InstanceDocumentationStorageGetClassRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getInstanceDocumentationStorageGetClassAttributeTypeOk(arg InstanceDocument return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceDocumentationStorageGetClassAttributeType(arg *InstanceDocumentationStorageGetClassAttributeType, val InstanceDocumentationStorageGetClassRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceDocumentationStorageGetClassArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceDocumentationStorageGetClassRetType = string /* @@ -43,10 +50,16 @@ type InstanceDocumentationStorageGetClassRetType = string */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceDocumentationStorageGetSizeAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceDocumentationStorageGetSizeArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceDocumentationStorageGetSizeRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceDocumentationStorageGetSizeAttributeTypeOk(arg InstanceDocumentationStorageGetSizeAttributeType) (ret InstanceDocumentationStorageGetSizeRetType, ok bool) { if arg == nil { return ret, false @@ -54,11 +67,13 @@ func getInstanceDocumentationStorageGetSizeAttributeTypeOk(arg InstanceDocumenta return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceDocumentationStorageGetSizeAttributeType(arg *InstanceDocumentationStorageGetSizeAttributeType, val InstanceDocumentationStorageGetSizeRetType) { *arg = &val } // InstanceDocumentationStorage struct for InstanceDocumentationStorage +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceDocumentationStorage struct { // Class of the instance. Class InstanceDocumentationStorageGetClassAttributeType `json:"class,omitempty"` @@ -70,6 +85,7 @@ type InstanceDocumentationStorage 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 NewInstanceDocumentationStorage() *InstanceDocumentationStorage { this := InstanceDocumentationStorage{} return &this @@ -78,6 +94,7 @@ func NewInstanceDocumentationStorage() *InstanceDocumentationStorage { // NewInstanceDocumentationStorageWithDefaults instantiates a new InstanceDocumentationStorage object // This 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 NewInstanceDocumentationStorageWithDefaults() *InstanceDocumentationStorage { this := InstanceDocumentationStorage{} var class string = "premium-perf12-stackit" @@ -86,6 +103,7 @@ func NewInstanceDocumentationStorageWithDefaults() *InstanceDocumentationStorage } // 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 *InstanceDocumentationStorage) GetClass() (res InstanceDocumentationStorageGetClassRetType) { res, _ = o.GetClassOk() return @@ -93,22 +111,26 @@ func (o *InstanceDocumentationStorage) GetClass() (res InstanceDocumentationStor // 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 *InstanceDocumentationStorage) GetClassOk() (ret InstanceDocumentationStorageGetClassRetType, ok bool) { return getInstanceDocumentationStorageGetClassAttributeTypeOk(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 *InstanceDocumentationStorage) 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 *InstanceDocumentationStorage) SetClass(v InstanceDocumentationStorageGetClassRetType) { setInstanceDocumentationStorageGetClassAttributeType(&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 *InstanceDocumentationStorage) GetSize() (res InstanceDocumentationStorageGetSizeRetType) { res, _ = o.GetSizeOk() return @@ -116,21 +138,25 @@ func (o *InstanceDocumentationStorage) GetSize() (res InstanceDocumentationStora // 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 *InstanceDocumentationStorage) GetSizeOk() (ret InstanceDocumentationStorageGetSizeRetType, ok bool) { return getInstanceDocumentationStorageGetSizeAttributeTypeOk(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 *InstanceDocumentationStorage) 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 *InstanceDocumentationStorage) SetSize(v InstanceDocumentationStorageGetSizeRetType) { setInstanceDocumentationStorageGetSizeAttributeType(&o.Size, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o InstanceDocumentationStorage) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getInstanceDocumentationStorageGetClassAttributeTypeOk(o.Class); ok { @@ -142,37 +168,45 @@ func (o InstanceDocumentationStorage) 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 NullableInstanceDocumentationStorage struct { value *InstanceDocumentationStorage isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInstanceDocumentationStorage) Get() *InstanceDocumentationStorage { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInstanceDocumentationStorage) Set(val *InstanceDocumentationStorage) { 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 NullableInstanceDocumentationStorage) 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 *NullableInstanceDocumentationStorage) 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 NewNullableInstanceDocumentationStorage(val *InstanceDocumentationStorage) *NullableInstanceDocumentationStorage { return &NullableInstanceDocumentationStorage{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 NullableInstanceDocumentationStorage) 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 *NullableInstanceDocumentationStorage) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/sqlserverflex/model_instance_error.go b/services/sqlserverflex/model_instance_error.go index 4f32c7474..131139408 100644 --- a/services/sqlserverflex/model_instance_error.go +++ b/services/sqlserverflex/model_instance_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 sqlserverflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &InstanceError{} */ // isInteger +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceErrorGetCodeAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceErrorGetCodeArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceErrorGetCodeRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceErrorGetCodeAttributeTypeOk(arg InstanceErrorGetCodeAttributeType) (ret InstanceErrorGetCodeRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getInstanceErrorGetCodeAttributeTypeOk(arg InstanceErrorGetCodeAttributeTyp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceErrorGetCodeAttributeType(arg *InstanceErrorGetCodeAttributeType, val InstanceErrorGetCodeRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setInstanceErrorGetCodeAttributeType(arg *InstanceErrorGetCodeAttributeType */ // isContainer +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceErrorGetFieldsAttributeType = *map[string][]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceErrorGetFieldsArgType = map[string][]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceErrorGetFieldsRetType = map[string][]string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceErrorGetFieldsAttributeTypeOk(arg InstanceErrorGetFieldsAttributeType) (ret InstanceErrorGetFieldsRetType, ok bool) { if arg == nil { return ret, false @@ -53,6 +67,7 @@ func getInstanceErrorGetFieldsAttributeTypeOk(arg InstanceErrorGetFieldsAttribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceErrorGetFieldsAttributeType(arg *InstanceErrorGetFieldsAttributeType, val InstanceErrorGetFieldsRetType) { *arg = &val } @@ -62,8 +77,10 @@ func setInstanceErrorGetFieldsAttributeType(arg *InstanceErrorGetFieldsAttribute */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceErrorGetMessageAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceErrorGetMessageAttributeTypeOk(arg InstanceErrorGetMessageAttributeType) (ret InstanceErrorGetMessageRetType, ok bool) { if arg == nil { return ret, false @@ -71,11 +88,15 @@ func getInstanceErrorGetMessageAttributeTypeOk(arg InstanceErrorGetMessageAttrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceErrorGetMessageAttributeType(arg *InstanceErrorGetMessageAttributeType, val InstanceErrorGetMessageRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceErrorGetMessageArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceErrorGetMessageRetType = string /* @@ -83,10 +104,16 @@ type InstanceErrorGetMessageRetType = string */ // isEnumRef +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceErrorGetTypeAttributeType = *Type + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceErrorGetTypeArgType = Type + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceErrorGetTypeRetType = Type +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceErrorGetTypeAttributeTypeOk(arg InstanceErrorGetTypeAttributeType) (ret InstanceErrorGetTypeRetType, ok bool) { if arg == nil { return ret, false @@ -94,11 +121,13 @@ func getInstanceErrorGetTypeAttributeTypeOk(arg InstanceErrorGetTypeAttributeTyp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceErrorGetTypeAttributeType(arg *InstanceErrorGetTypeAttributeType, val InstanceErrorGetTypeRetType) { *arg = &val } // InstanceError struct for InstanceError +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceError struct { // Can be cast to int32 without loss of precision. Code InstanceErrorGetCodeAttributeType `json:"code,omitempty"` @@ -111,6 +140,7 @@ type InstanceError 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 NewInstanceError() *InstanceError { this := InstanceError{} return &this @@ -119,12 +149,14 @@ func NewInstanceError() *InstanceError { // NewInstanceErrorWithDefaults instantiates a new InstanceError object // This 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 NewInstanceErrorWithDefaults() *InstanceError { this := InstanceError{} 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 *InstanceError) GetCode() (res InstanceErrorGetCodeRetType) { res, _ = o.GetCodeOk() return @@ -132,22 +164,26 @@ func (o *InstanceError) GetCode() (res InstanceErrorGetCodeRetType) { // 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 *InstanceError) GetCodeOk() (ret InstanceErrorGetCodeRetType, ok bool) { return getInstanceErrorGetCodeAttributeTypeOk(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 *InstanceError) 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 *InstanceError) SetCode(v InstanceErrorGetCodeRetType) { setInstanceErrorGetCodeAttributeType(&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 *InstanceError) GetFields() (res InstanceErrorGetFieldsRetType) { res, _ = o.GetFieldsOk() return @@ -155,22 +191,26 @@ func (o *InstanceError) GetFields() (res InstanceErrorGetFieldsRetType) { // 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 *InstanceError) GetFieldsOk() (ret InstanceErrorGetFieldsRetType, ok bool) { return getInstanceErrorGetFieldsAttributeTypeOk(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 *InstanceError) 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 *InstanceError) SetFields(v InstanceErrorGetFieldsRetType) { setInstanceErrorGetFieldsAttributeType(&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 *InstanceError) GetMessage() (res InstanceErrorGetMessageRetType) { res, _ = o.GetMessageOk() return @@ -178,22 +218,26 @@ func (o *InstanceError) GetMessage() (res InstanceErrorGetMessageRetType) { // 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 *InstanceError) GetMessageOk() (ret InstanceErrorGetMessageRetType, ok bool) { return getInstanceErrorGetMessageAttributeTypeOk(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 *InstanceError) 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 *InstanceError) SetMessage(v InstanceErrorGetMessageRetType) { setInstanceErrorGetMessageAttributeType(&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 *InstanceError) GetType() (res InstanceErrorGetTypeRetType) { res, _ = o.GetTypeOk() return @@ -201,21 +245,25 @@ func (o *InstanceError) GetType() (res InstanceErrorGetTypeRetType) { // 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 *InstanceError) GetTypeOk() (ret InstanceErrorGetTypeRetType, ok bool) { return getInstanceErrorGetTypeAttributeTypeOk(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 *InstanceError) HasType() bool { _, ok := o.GetTypeOk() return ok } // SetType gets a reference to the given Type 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 *InstanceError) SetType(v InstanceErrorGetTypeRetType) { setInstanceErrorGetTypeAttributeType(&o.Type, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o InstanceError) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getInstanceErrorGetCodeAttributeTypeOk(o.Code); ok { @@ -233,37 +281,45 @@ func (o InstanceError) 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 NullableInstanceError struct { value *InstanceError isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInstanceError) Get() *InstanceError { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInstanceError) Set(val *InstanceError) { 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 NullableInstanceError) 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 *NullableInstanceError) 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 NewNullableInstanceError(val *InstanceError) *NullableInstanceError { return &NullableInstanceError{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 NullableInstanceError) 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 *NullableInstanceError) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/sqlserverflex/model_instance_flavor_entry.go b/services/sqlserverflex/model_instance_flavor_entry.go index 648e2056c..8c3bb9eb9 100644 --- a/services/sqlserverflex/model_instance_flavor_entry.go +++ b/services/sqlserverflex/model_instance_flavor_entry.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 sqlserverflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &InstanceFlavorEntry{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceFlavorEntryGetCategoriesAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceFlavorEntryGetCategoriesAttributeTypeOk(arg InstanceFlavorEntryGetCategoriesAttributeType) (ret InstanceFlavorEntryGetCategoriesRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getInstanceFlavorEntryGetCategoriesAttributeTypeOk(arg InstanceFlavorEntryG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceFlavorEntryGetCategoriesAttributeType(arg *InstanceFlavorEntryGetCategoriesAttributeType, val InstanceFlavorEntryGetCategoriesRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceFlavorEntryGetCategoriesArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceFlavorEntryGetCategoriesRetType = string /* @@ -43,10 +50,16 @@ type InstanceFlavorEntryGetCategoriesRetType = string */ // isInteger +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceFlavorEntryGetCpuAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceFlavorEntryGetCpuArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceFlavorEntryGetCpuRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceFlavorEntryGetCpuAttributeTypeOk(arg InstanceFlavorEntryGetCpuAttributeType) (ret InstanceFlavorEntryGetCpuRetType, ok bool) { if arg == nil { return ret, false @@ -54,6 +67,7 @@ func getInstanceFlavorEntryGetCpuAttributeTypeOk(arg InstanceFlavorEntryGetCpuAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceFlavorEntryGetCpuAttributeType(arg *InstanceFlavorEntryGetCpuAttributeType, val InstanceFlavorEntryGetCpuRetType) { *arg = &val } @@ -63,8 +77,10 @@ func setInstanceFlavorEntryGetCpuAttributeType(arg *InstanceFlavorEntryGetCpuAtt */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceFlavorEntryGetDescriptionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceFlavorEntryGetDescriptionAttributeTypeOk(arg InstanceFlavorEntryGetDescriptionAttributeType) (ret InstanceFlavorEntryGetDescriptionRetType, ok bool) { if arg == nil { return ret, false @@ -72,11 +88,15 @@ func getInstanceFlavorEntryGetDescriptionAttributeTypeOk(arg InstanceFlavorEntry return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceFlavorEntryGetDescriptionAttributeType(arg *InstanceFlavorEntryGetDescriptionAttributeType, val InstanceFlavorEntryGetDescriptionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceFlavorEntryGetDescriptionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceFlavorEntryGetDescriptionRetType = string /* @@ -84,8 +104,10 @@ type InstanceFlavorEntryGetDescriptionRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceFlavorEntryGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceFlavorEntryGetIdAttributeTypeOk(arg InstanceFlavorEntryGetIdAttributeType) (ret InstanceFlavorEntryGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -93,11 +115,15 @@ func getInstanceFlavorEntryGetIdAttributeTypeOk(arg InstanceFlavorEntryGetIdAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceFlavorEntryGetIdAttributeType(arg *InstanceFlavorEntryGetIdAttributeType, val InstanceFlavorEntryGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceFlavorEntryGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceFlavorEntryGetIdRetType = string /* @@ -105,10 +131,16 @@ type InstanceFlavorEntryGetIdRetType = string */ // isInteger +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceFlavorEntryGetMemoryAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceFlavorEntryGetMemoryArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceFlavorEntryGetMemoryRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceFlavorEntryGetMemoryAttributeTypeOk(arg InstanceFlavorEntryGetMemoryAttributeType) (ret InstanceFlavorEntryGetMemoryRetType, ok bool) { if arg == nil { return ret, false @@ -116,11 +148,13 @@ func getInstanceFlavorEntryGetMemoryAttributeTypeOk(arg InstanceFlavorEntryGetMe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceFlavorEntryGetMemoryAttributeType(arg *InstanceFlavorEntryGetMemoryAttributeType, val InstanceFlavorEntryGetMemoryRetType) { *arg = &val } // InstanceFlavorEntry struct for InstanceFlavorEntry +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceFlavorEntry struct { Categories InstanceFlavorEntryGetCategoriesAttributeType `json:"categories,omitempty"` // Can be cast to int32 without loss of precision. @@ -135,6 +169,7 @@ type InstanceFlavorEntry 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 NewInstanceFlavorEntry() *InstanceFlavorEntry { this := InstanceFlavorEntry{} return &this @@ -143,12 +178,14 @@ func NewInstanceFlavorEntry() *InstanceFlavorEntry { // NewInstanceFlavorEntryWithDefaults instantiates a new InstanceFlavorEntry object // This 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 NewInstanceFlavorEntryWithDefaults() *InstanceFlavorEntry { this := InstanceFlavorEntry{} return &this } // GetCategories returns the Categories field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceFlavorEntry) GetCategories() (res InstanceFlavorEntryGetCategoriesRetType) { res, _ = o.GetCategoriesOk() return @@ -156,22 +193,26 @@ func (o *InstanceFlavorEntry) GetCategories() (res InstanceFlavorEntryGetCategor // GetCategoriesOk returns a tuple with the Categories field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceFlavorEntry) GetCategoriesOk() (ret InstanceFlavorEntryGetCategoriesRetType, ok bool) { return getInstanceFlavorEntryGetCategoriesAttributeTypeOk(o.Categories) } // HasCategories returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceFlavorEntry) HasCategories() bool { _, ok := o.GetCategoriesOk() return ok } // SetCategories gets a reference to the given string and assigns it to the Categories field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InstanceFlavorEntry) SetCategories(v InstanceFlavorEntryGetCategoriesRetType) { setInstanceFlavorEntryGetCategoriesAttributeType(&o.Categories, v) } // 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 *InstanceFlavorEntry) GetCpu() (res InstanceFlavorEntryGetCpuRetType) { res, _ = o.GetCpuOk() return @@ -179,22 +220,26 @@ func (o *InstanceFlavorEntry) GetCpu() (res InstanceFlavorEntryGetCpuRetType) { // 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 *InstanceFlavorEntry) GetCpuOk() (ret InstanceFlavorEntryGetCpuRetType, ok bool) { return getInstanceFlavorEntryGetCpuAttributeTypeOk(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 *InstanceFlavorEntry) 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 *InstanceFlavorEntry) SetCpu(v InstanceFlavorEntryGetCpuRetType) { setInstanceFlavorEntryGetCpuAttributeType(&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 *InstanceFlavorEntry) GetDescription() (res InstanceFlavorEntryGetDescriptionRetType) { res, _ = o.GetDescriptionOk() return @@ -202,22 +247,26 @@ func (o *InstanceFlavorEntry) GetDescription() (res InstanceFlavorEntryGetDescri // 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 *InstanceFlavorEntry) GetDescriptionOk() (ret InstanceFlavorEntryGetDescriptionRetType, ok bool) { return getInstanceFlavorEntryGetDescriptionAttributeTypeOk(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 *InstanceFlavorEntry) 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 *InstanceFlavorEntry) SetDescription(v InstanceFlavorEntryGetDescriptionRetType) { setInstanceFlavorEntryGetDescriptionAttributeType(&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 *InstanceFlavorEntry) GetId() (res InstanceFlavorEntryGetIdRetType) { res, _ = o.GetIdOk() return @@ -225,22 +274,26 @@ func (o *InstanceFlavorEntry) GetId() (res InstanceFlavorEntryGetIdRetType) { // 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 *InstanceFlavorEntry) GetIdOk() (ret InstanceFlavorEntryGetIdRetType, ok bool) { return getInstanceFlavorEntryGetIdAttributeTypeOk(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 *InstanceFlavorEntry) 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 *InstanceFlavorEntry) SetId(v InstanceFlavorEntryGetIdRetType) { setInstanceFlavorEntryGetIdAttributeType(&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 *InstanceFlavorEntry) GetMemory() (res InstanceFlavorEntryGetMemoryRetType) { res, _ = o.GetMemoryOk() return @@ -248,21 +301,25 @@ func (o *InstanceFlavorEntry) GetMemory() (res InstanceFlavorEntryGetMemoryRetTy // 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 *InstanceFlavorEntry) GetMemoryOk() (ret InstanceFlavorEntryGetMemoryRetType, ok bool) { return getInstanceFlavorEntryGetMemoryAttributeTypeOk(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 *InstanceFlavorEntry) 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 *InstanceFlavorEntry) SetMemory(v InstanceFlavorEntryGetMemoryRetType) { setInstanceFlavorEntryGetMemoryAttributeType(&o.Memory, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o InstanceFlavorEntry) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getInstanceFlavorEntryGetCategoriesAttributeTypeOk(o.Categories); ok { @@ -283,37 +340,45 @@ func (o InstanceFlavorEntry) 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 NullableInstanceFlavorEntry struct { value *InstanceFlavorEntry isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInstanceFlavorEntry) Get() *InstanceFlavorEntry { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInstanceFlavorEntry) Set(val *InstanceFlavorEntry) { 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 NullableInstanceFlavorEntry) 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 *NullableInstanceFlavorEntry) 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 NewNullableInstanceFlavorEntry(val *InstanceFlavorEntry) *NullableInstanceFlavorEntry { return &NullableInstanceFlavorEntry{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 NullableInstanceFlavorEntry) 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 *NullableInstanceFlavorEntry) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/sqlserverflex/model_instance_list_instance.go b/services/sqlserverflex/model_instance_list_instance.go index f376434d3..5c882c779 100644 --- a/services/sqlserverflex/model_instance_list_instance.go +++ b/services/sqlserverflex/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 sqlserverflex 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/sqlserverflex/model_instance_list_user.go b/services/sqlserverflex/model_instance_list_user.go index 390a826ea..0a350940f 100644 --- a/services/sqlserverflex/model_instance_list_user.go +++ b/services/sqlserverflex/model_instance_list_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 sqlserverflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &InstanceListUser{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceListUserGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceListUserGetIdAttributeTypeOk(arg InstanceListUserGetIdAttributeType) (ret InstanceListUserGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getInstanceListUserGetIdAttributeTypeOk(arg InstanceListUserGetIdAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceListUserGetIdAttributeType(arg *InstanceListUserGetIdAttributeType, val InstanceListUserGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceListUserGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceListUserGetIdRetType = string /* @@ -43,8 +50,10 @@ type InstanceListUserGetIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceListUserGetUsernameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceListUserGetUsernameAttributeTypeOk(arg InstanceListUserGetUsernameAttributeType) (ret InstanceListUserGetUsernameRetType, ok bool) { if arg == nil { return ret, false @@ -52,14 +61,19 @@ func getInstanceListUserGetUsernameAttributeTypeOk(arg InstanceListUserGetUserna return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceListUserGetUsernameAttributeType(arg *InstanceListUserGetUsernameAttributeType, val InstanceListUserGetUsernameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceListUserGetUsernameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceListUserGetUsernameRetType = string // InstanceListUser struct for InstanceListUser +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceListUser struct { Id InstanceListUserGetIdAttributeType `json:"id,omitempty"` Username InstanceListUserGetUsernameAttributeType `json:"username,omitempty"` @@ -69,6 +83,7 @@ type InstanceListUser 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 NewInstanceListUser() *InstanceListUser { this := InstanceListUser{} return &this @@ -77,12 +92,14 @@ func NewInstanceListUser() *InstanceListUser { // NewInstanceListUserWithDefaults instantiates a new InstanceListUser object // This 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 NewInstanceListUserWithDefaults() *InstanceListUser { this := InstanceListUser{} 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 *InstanceListUser) GetId() (res InstanceListUserGetIdRetType) { res, _ = o.GetIdOk() return @@ -90,22 +107,26 @@ func (o *InstanceListUser) GetId() (res InstanceListUserGetIdRetType) { // 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 *InstanceListUser) GetIdOk() (ret InstanceListUserGetIdRetType, ok bool) { return getInstanceListUserGetIdAttributeTypeOk(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 *InstanceListUser) 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 *InstanceListUser) SetId(v InstanceListUserGetIdRetType) { setInstanceListUserGetIdAttributeType(&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 *InstanceListUser) GetUsername() (res InstanceListUserGetUsernameRetType) { res, _ = o.GetUsernameOk() return @@ -113,21 +134,25 @@ func (o *InstanceListUser) GetUsername() (res InstanceListUserGetUsernameRetType // 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 *InstanceListUser) GetUsernameOk() (ret InstanceListUserGetUsernameRetType, ok bool) { return getInstanceListUserGetUsernameAttributeTypeOk(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 *InstanceListUser) 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 *InstanceListUser) SetUsername(v InstanceListUserGetUsernameRetType) { setInstanceListUserGetUsernameAttributeType(&o.Username, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o InstanceListUser) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getInstanceListUserGetIdAttributeTypeOk(o.Id); ok { @@ -139,37 +164,45 @@ func (o InstanceListUser) 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 NullableInstanceListUser struct { value *InstanceListUser isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInstanceListUser) Get() *InstanceListUser { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInstanceListUser) Set(val *InstanceListUser) { 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 NullableInstanceListUser) 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 *NullableInstanceListUser) 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 NewNullableInstanceListUser(val *InstanceListUser) *NullableInstanceListUser { return &NullableInstanceListUser{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 NullableInstanceListUser) 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 *NullableInstanceListUser) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/sqlserverflex/model_list_backups_response.go b/services/sqlserverflex/model_list_backups_response.go index 10291c506..eb35dec72 100644 --- a/services/sqlserverflex/model_list_backups_response.go +++ b/services/sqlserverflex/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 sqlserverflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ListBackupsResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListBackupsResponseGetDatabasesAttributeType = *[]BackupListBackupsResponseGrouped + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListBackupsResponseGetDatabasesArgType = []BackupListBackupsResponseGrouped + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListBackupsResponseGetDatabasesRetType = []BackupListBackupsResponseGrouped +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getListBackupsResponseGetDatabasesAttributeTypeOk(arg ListBackupsResponseGetDatabasesAttributeType) (ret ListBackupsResponseGetDatabasesRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getListBackupsResponseGetDatabasesAttributeTypeOk(arg ListBackupsResponseGe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setListBackupsResponseGetDatabasesAttributeType(arg *ListBackupsResponseGetDatabasesAttributeType, val ListBackupsResponseGetDatabasesRetType) { *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 { Databases ListBackupsResponseGetDatabasesAttributeType `json:"databases,omitempty"` } @@ -46,6 +55,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 @@ -54,12 +64,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 } // 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 *ListBackupsResponse) GetDatabases() (res ListBackupsResponseGetDatabasesRetType) { res, _ = o.GetDatabasesOk() return @@ -67,21 +79,25 @@ func (o *ListBackupsResponse) GetDatabases() (res ListBackupsResponseGetDatabase // 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 *ListBackupsResponse) GetDatabasesOk() (ret ListBackupsResponseGetDatabasesRetType, ok bool) { return getListBackupsResponseGetDatabasesAttributeTypeOk(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 *ListBackupsResponse) HasDatabases() bool { _, ok := o.GetDatabasesOk() return ok } // SetDatabases gets a reference to the given []BackupListBackupsResponseGrouped 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 *ListBackupsResponse) SetDatabases(v ListBackupsResponseGetDatabasesRetType) { setListBackupsResponseGetDatabasesAttributeType(&o.Databases, 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 := getListBackupsResponseGetDatabasesAttributeTypeOk(o.Databases); ok { @@ -90,37 +106,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/sqlserverflex/model_list_collations_response.go b/services/sqlserverflex/model_list_collations_response.go index 23c1df237..82d48cf8e 100644 --- a/services/sqlserverflex/model_list_collations_response.go +++ b/services/sqlserverflex/model_list_collations_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 sqlserverflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ListCollationsResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListCollationsResponseGetCollationsAttributeType = *[]MssqlDatabaseCollation + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListCollationsResponseGetCollationsArgType = []MssqlDatabaseCollation + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListCollationsResponseGetCollationsRetType = []MssqlDatabaseCollation +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getListCollationsResponseGetCollationsAttributeTypeOk(arg ListCollationsResponseGetCollationsAttributeType) (ret ListCollationsResponseGetCollationsRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getListCollationsResponseGetCollationsAttributeTypeOk(arg ListCollationsRes return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setListCollationsResponseGetCollationsAttributeType(arg *ListCollationsResponseGetCollationsAttributeType, val ListCollationsResponseGetCollationsRetType) { *arg = &val } // ListCollationsResponse struct for ListCollationsResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListCollationsResponse struct { Collations ListCollationsResponseGetCollationsAttributeType `json:"collations,omitempty"` } @@ -46,6 +55,7 @@ type ListCollationsResponse 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 NewListCollationsResponse() *ListCollationsResponse { this := ListCollationsResponse{} return &this @@ -54,12 +64,14 @@ func NewListCollationsResponse() *ListCollationsResponse { // NewListCollationsResponseWithDefaults instantiates a new ListCollationsResponse object // This 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 NewListCollationsResponseWithDefaults() *ListCollationsResponse { this := ListCollationsResponse{} return &this } // GetCollations returns the Collations field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListCollationsResponse) GetCollations() (res ListCollationsResponseGetCollationsRetType) { res, _ = o.GetCollationsOk() return @@ -67,21 +79,25 @@ func (o *ListCollationsResponse) GetCollations() (res ListCollationsResponseGetC // GetCollationsOk returns a tuple with the Collations field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListCollationsResponse) GetCollationsOk() (ret ListCollationsResponseGetCollationsRetType, ok bool) { return getListCollationsResponseGetCollationsAttributeTypeOk(o.Collations) } // HasCollations returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListCollationsResponse) HasCollations() bool { _, ok := o.GetCollationsOk() return ok } // SetCollations gets a reference to the given []MssqlDatabaseCollation and assigns it to the Collations field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListCollationsResponse) SetCollations(v ListCollationsResponseGetCollationsRetType) { setListCollationsResponseGetCollationsAttributeType(&o.Collations, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ListCollationsResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getListCollationsResponseGetCollationsAttributeTypeOk(o.Collations); ok { @@ -90,37 +106,45 @@ func (o ListCollationsResponse) 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 NullableListCollationsResponse struct { value *ListCollationsResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableListCollationsResponse) Get() *ListCollationsResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableListCollationsResponse) Set(val *ListCollationsResponse) { 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 NullableListCollationsResponse) 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 *NullableListCollationsResponse) 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 NewNullableListCollationsResponse(val *ListCollationsResponse) *NullableListCollationsResponse { return &NullableListCollationsResponse{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 NullableListCollationsResponse) 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 *NullableListCollationsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/sqlserverflex/model_list_compatibility_response.go b/services/sqlserverflex/model_list_compatibility_response.go index 202bc9d7e..7d72ffb4b 100644 --- a/services/sqlserverflex/model_list_compatibility_response.go +++ b/services/sqlserverflex/model_list_compatibility_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 sqlserverflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ListCompatibilityResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListCompatibilityResponseGetCompatibilitiesAttributeType = *[]MssqlDatabaseCompatibility + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListCompatibilityResponseGetCompatibilitiesArgType = []MssqlDatabaseCompatibility + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListCompatibilityResponseGetCompatibilitiesRetType = []MssqlDatabaseCompatibility +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getListCompatibilityResponseGetCompatibilitiesAttributeTypeOk(arg ListCompatibilityResponseGetCompatibilitiesAttributeType) (ret ListCompatibilityResponseGetCompatibilitiesRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getListCompatibilityResponseGetCompatibilitiesAttributeTypeOk(arg ListCompa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setListCompatibilityResponseGetCompatibilitiesAttributeType(arg *ListCompatibilityResponseGetCompatibilitiesAttributeType, val ListCompatibilityResponseGetCompatibilitiesRetType) { *arg = &val } // ListCompatibilityResponse struct for ListCompatibilityResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListCompatibilityResponse struct { Compatibilities ListCompatibilityResponseGetCompatibilitiesAttributeType `json:"compatibilities,omitempty"` } @@ -46,6 +55,7 @@ type ListCompatibilityResponse 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 NewListCompatibilityResponse() *ListCompatibilityResponse { this := ListCompatibilityResponse{} return &this @@ -54,12 +64,14 @@ func NewListCompatibilityResponse() *ListCompatibilityResponse { // NewListCompatibilityResponseWithDefaults instantiates a new ListCompatibilityResponse object // This 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 NewListCompatibilityResponseWithDefaults() *ListCompatibilityResponse { this := ListCompatibilityResponse{} return &this } // GetCompatibilities returns the Compatibilities field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListCompatibilityResponse) GetCompatibilities() (res ListCompatibilityResponseGetCompatibilitiesRetType) { res, _ = o.GetCompatibilitiesOk() return @@ -67,21 +79,25 @@ func (o *ListCompatibilityResponse) GetCompatibilities() (res ListCompatibilityR // GetCompatibilitiesOk returns a tuple with the Compatibilities field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListCompatibilityResponse) GetCompatibilitiesOk() (ret ListCompatibilityResponseGetCompatibilitiesRetType, ok bool) { return getListCompatibilityResponseGetCompatibilitiesAttributeTypeOk(o.Compatibilities) } // HasCompatibilities returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListCompatibilityResponse) HasCompatibilities() bool { _, ok := o.GetCompatibilitiesOk() return ok } // SetCompatibilities gets a reference to the given []MssqlDatabaseCompatibility and assigns it to the Compatibilities field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListCompatibilityResponse) SetCompatibilities(v ListCompatibilityResponseGetCompatibilitiesRetType) { setListCompatibilityResponseGetCompatibilitiesAttributeType(&o.Compatibilities, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ListCompatibilityResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getListCompatibilityResponseGetCompatibilitiesAttributeTypeOk(o.Compatibilities); ok { @@ -90,37 +106,45 @@ func (o ListCompatibilityResponse) 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 NullableListCompatibilityResponse struct { value *ListCompatibilityResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableListCompatibilityResponse) Get() *ListCompatibilityResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableListCompatibilityResponse) Set(val *ListCompatibilityResponse) { 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 NullableListCompatibilityResponse) 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 *NullableListCompatibilityResponse) 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 NewNullableListCompatibilityResponse(val *ListCompatibilityResponse) *NullableListCompatibilityResponse { return &NullableListCompatibilityResponse{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 NullableListCompatibilityResponse) 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 *NullableListCompatibilityResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/sqlserverflex/model_list_databases_response.go b/services/sqlserverflex/model_list_databases_response.go index 29319a940..cf8529135 100644 --- a/services/sqlserverflex/model_list_databases_response.go +++ b/services/sqlserverflex/model_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 sqlserverflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ListDatabasesResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListDatabasesResponseGetDatabasesAttributeType = *[]Database + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListDatabasesResponseGetDatabasesArgType = []Database + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListDatabasesResponseGetDatabasesRetType = []Database +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getListDatabasesResponseGetDatabasesAttributeTypeOk(arg ListDatabasesResponseGetDatabasesAttributeType) (ret ListDatabasesResponseGetDatabasesRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getListDatabasesResponseGetDatabasesAttributeTypeOk(arg ListDatabasesRespon return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setListDatabasesResponseGetDatabasesAttributeType(arg *ListDatabasesResponseGetDatabasesAttributeType, val ListDatabasesResponseGetDatabasesRetType) { *arg = &val } // ListDatabasesResponse struct for ListDatabasesResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListDatabasesResponse struct { Databases ListDatabasesResponseGetDatabasesAttributeType `json:"databases,omitempty"` } @@ -46,6 +55,7 @@ type ListDatabasesResponse 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 NewListDatabasesResponse() *ListDatabasesResponse { this := ListDatabasesResponse{} return &this @@ -54,12 +64,14 @@ func NewListDatabasesResponse() *ListDatabasesResponse { // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewListDatabasesResponseWithDefaults() *ListDatabasesResponse { this := ListDatabasesResponse{} 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 *ListDatabasesResponse) GetDatabases() (res ListDatabasesResponseGetDatabasesRetType) { res, _ = o.GetDatabasesOk() return @@ -67,21 +79,25 @@ func (o *ListDatabasesResponse) GetDatabases() (res ListDatabasesResponseGetData // 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 *ListDatabasesResponse) GetDatabasesOk() (ret ListDatabasesResponseGetDatabasesRetType, ok bool) { return getListDatabasesResponseGetDatabasesAttributeTypeOk(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 *ListDatabasesResponse) HasDatabases() bool { _, ok := o.GetDatabasesOk() return ok } // SetDatabases gets a reference to the given []Database 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 *ListDatabasesResponse) SetDatabases(v ListDatabasesResponseGetDatabasesRetType) { setListDatabasesResponseGetDatabasesAttributeType(&o.Databases, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ListDatabasesResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getListDatabasesResponseGetDatabasesAttributeTypeOk(o.Databases); ok { @@ -90,37 +106,45 @@ func (o ListDatabasesResponse) 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 NullableListDatabasesResponse struct { value *ListDatabasesResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableListDatabasesResponse) Get() *ListDatabasesResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableListDatabasesResponse) Set(val *ListDatabasesResponse) { 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 NullableListDatabasesResponse) 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 *NullableListDatabasesResponse) 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 NewNullableListDatabasesResponse(val *ListDatabasesResponse) *NullableListDatabasesResponse { return &NullableListDatabasesResponse{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 NullableListDatabasesResponse) 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 *NullableListDatabasesResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/sqlserverflex/model_list_flavors_response.go b/services/sqlserverflex/model_list_flavors_response.go index 7fe9008b5..e05be1924 100644 --- a/services/sqlserverflex/model_list_flavors_response.go +++ b/services/sqlserverflex/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 sqlserverflex 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 = *[]InstanceFlavorEntry + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListFlavorsResponseGetFlavorsArgType = []InstanceFlavorEntry + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListFlavorsResponseGetFlavorsRetType = []InstanceFlavorEntry +// 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 []InstanceFlavorEntry 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/sqlserverflex/model_list_instances_response.go b/services/sqlserverflex/model_list_instances_response.go index a6213d1eb..279329fdd 100644 --- a/services/sqlserverflex/model_list_instances_response.go +++ b/services/sqlserverflex/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 sqlserverflex 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/sqlserverflex/model_list_metrics_response.go b/services/sqlserverflex/model_list_metrics_response.go index 6c0e0d49d..af92555e4 100644 --- a/services/sqlserverflex/model_list_metrics_response.go +++ b/services/sqlserverflex/model_list_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 sqlserverflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ListMetricsResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListMetricsResponseGetHostsAttributeType = *[]Host + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListMetricsResponseGetHostsArgType = []Host + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListMetricsResponseGetHostsRetType = []Host +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getListMetricsResponseGetHostsAttributeTypeOk(arg ListMetricsResponseGetHostsAttributeType) (ret ListMetricsResponseGetHostsRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getListMetricsResponseGetHostsAttributeTypeOk(arg ListMetricsResponseGetHos return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setListMetricsResponseGetHostsAttributeType(arg *ListMetricsResponseGetHostsAttributeType, val ListMetricsResponseGetHostsRetType) { *arg = &val } // ListMetricsResponse struct for ListMetricsResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListMetricsResponse struct { Hosts ListMetricsResponseGetHostsAttributeType `json:"hosts,omitempty"` } @@ -46,6 +55,7 @@ type ListMetricsResponse 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 NewListMetricsResponse() *ListMetricsResponse { this := ListMetricsResponse{} return &this @@ -54,12 +64,14 @@ func NewListMetricsResponse() *ListMetricsResponse { // NewListMetricsResponseWithDefaults instantiates a new ListMetricsResponse object // This 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 NewListMetricsResponseWithDefaults() *ListMetricsResponse { this := ListMetricsResponse{} 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 *ListMetricsResponse) GetHosts() (res ListMetricsResponseGetHostsRetType) { res, _ = o.GetHostsOk() return @@ -67,21 +79,25 @@ func (o *ListMetricsResponse) GetHosts() (res ListMetricsResponseGetHostsRetType // 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 *ListMetricsResponse) GetHostsOk() (ret ListMetricsResponseGetHostsRetType, ok bool) { return getListMetricsResponseGetHostsAttributeTypeOk(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 *ListMetricsResponse) HasHosts() bool { _, ok := o.GetHostsOk() return ok } // SetHosts gets a reference to the given []Host 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 *ListMetricsResponse) SetHosts(v ListMetricsResponseGetHostsRetType) { setListMetricsResponseGetHostsAttributeType(&o.Hosts, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ListMetricsResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getListMetricsResponseGetHostsAttributeTypeOk(o.Hosts); ok { @@ -90,37 +106,45 @@ func (o ListMetricsResponse) 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 NullableListMetricsResponse struct { value *ListMetricsResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableListMetricsResponse) Get() *ListMetricsResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableListMetricsResponse) Set(val *ListMetricsResponse) { 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 NullableListMetricsResponse) 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 *NullableListMetricsResponse) 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 NewNullableListMetricsResponse(val *ListMetricsResponse) *NullableListMetricsResponse { return &NullableListMetricsResponse{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 NullableListMetricsResponse) 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 *NullableListMetricsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/sqlserverflex/model_list_restore_jobs_response.go b/services/sqlserverflex/model_list_restore_jobs_response.go index 62dbd433e..0a5fb164f 100644 --- a/services/sqlserverflex/model_list_restore_jobs_response.go +++ b/services/sqlserverflex/model_list_restore_jobs_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 sqlserverflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ListRestoreJobsResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListRestoreJobsResponseGetRunningRestoresAttributeType = *[]RestoreRunningRestore + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListRestoreJobsResponseGetRunningRestoresArgType = []RestoreRunningRestore + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListRestoreJobsResponseGetRunningRestoresRetType = []RestoreRunningRestore +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getListRestoreJobsResponseGetRunningRestoresAttributeTypeOk(arg ListRestoreJobsResponseGetRunningRestoresAttributeType) (ret ListRestoreJobsResponseGetRunningRestoresRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getListRestoreJobsResponseGetRunningRestoresAttributeTypeOk(arg ListRestore return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setListRestoreJobsResponseGetRunningRestoresAttributeType(arg *ListRestoreJobsResponseGetRunningRestoresAttributeType, val ListRestoreJobsResponseGetRunningRestoresRetType) { *arg = &val } // ListRestoreJobsResponse struct for ListRestoreJobsResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListRestoreJobsResponse struct { RunningRestores ListRestoreJobsResponseGetRunningRestoresAttributeType `json:"runningRestores,omitempty"` } @@ -46,6 +55,7 @@ type ListRestoreJobsResponse 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 NewListRestoreJobsResponse() *ListRestoreJobsResponse { this := ListRestoreJobsResponse{} return &this @@ -54,12 +64,14 @@ func NewListRestoreJobsResponse() *ListRestoreJobsResponse { // NewListRestoreJobsResponseWithDefaults instantiates a new ListRestoreJobsResponse object // This 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 NewListRestoreJobsResponseWithDefaults() *ListRestoreJobsResponse { this := ListRestoreJobsResponse{} return &this } // GetRunningRestores returns the RunningRestores field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListRestoreJobsResponse) GetRunningRestores() (res ListRestoreJobsResponseGetRunningRestoresRetType) { res, _ = o.GetRunningRestoresOk() return @@ -67,21 +79,25 @@ func (o *ListRestoreJobsResponse) GetRunningRestores() (res ListRestoreJobsRespo // GetRunningRestoresOk returns a tuple with the RunningRestores field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListRestoreJobsResponse) GetRunningRestoresOk() (ret ListRestoreJobsResponseGetRunningRestoresRetType, ok bool) { return getListRestoreJobsResponseGetRunningRestoresAttributeTypeOk(o.RunningRestores) } // HasRunningRestores returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListRestoreJobsResponse) HasRunningRestores() bool { _, ok := o.GetRunningRestoresOk() return ok } // SetRunningRestores gets a reference to the given []RestoreRunningRestore and assigns it to the RunningRestores field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListRestoreJobsResponse) SetRunningRestores(v ListRestoreJobsResponseGetRunningRestoresRetType) { setListRestoreJobsResponseGetRunningRestoresAttributeType(&o.RunningRestores, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ListRestoreJobsResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getListRestoreJobsResponseGetRunningRestoresAttributeTypeOk(o.RunningRestores); ok { @@ -90,37 +106,45 @@ func (o ListRestoreJobsResponse) 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 NullableListRestoreJobsResponse struct { value *ListRestoreJobsResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableListRestoreJobsResponse) Get() *ListRestoreJobsResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableListRestoreJobsResponse) Set(val *ListRestoreJobsResponse) { 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 NullableListRestoreJobsResponse) 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 *NullableListRestoreJobsResponse) 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 NewNullableListRestoreJobsResponse(val *ListRestoreJobsResponse) *NullableListRestoreJobsResponse { return &NullableListRestoreJobsResponse{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 NullableListRestoreJobsResponse) 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 *NullableListRestoreJobsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/sqlserverflex/model_list_roles_response.go b/services/sqlserverflex/model_list_roles_response.go index dd62d529d..99018906f 100644 --- a/services/sqlserverflex/model_list_roles_response.go +++ b/services/sqlserverflex/model_list_roles_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 sqlserverflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ListRolesResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListRolesResponseGetRolesAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListRolesResponseGetRolesArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListRolesResponseGetRolesRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getListRolesResponseGetRolesAttributeTypeOk(arg ListRolesResponseGetRolesAttributeType) (ret ListRolesResponseGetRolesRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getListRolesResponseGetRolesAttributeTypeOk(arg ListRolesResponseGetRolesAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setListRolesResponseGetRolesAttributeType(arg *ListRolesResponseGetRolesAttributeType, val ListRolesResponseGetRolesRetType) { *arg = &val } // ListRolesResponse struct for ListRolesResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListRolesResponse struct { Roles ListRolesResponseGetRolesAttributeType `json:"roles,omitempty"` } @@ -46,6 +55,7 @@ type ListRolesResponse 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 NewListRolesResponse() *ListRolesResponse { this := ListRolesResponse{} return &this @@ -54,12 +64,14 @@ func NewListRolesResponse() *ListRolesResponse { // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewListRolesResponseWithDefaults() *ListRolesResponse { this := ListRolesResponse{} 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 *ListRolesResponse) GetRoles() (res ListRolesResponseGetRolesRetType) { res, _ = o.GetRolesOk() return @@ -67,21 +79,25 @@ func (o *ListRolesResponse) GetRoles() (res ListRolesResponseGetRolesRetType) { // 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 *ListRolesResponse) GetRolesOk() (ret ListRolesResponseGetRolesRetType, ok bool) { return getListRolesResponseGetRolesAttributeTypeOk(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 *ListRolesResponse) 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 *ListRolesResponse) SetRoles(v ListRolesResponseGetRolesRetType) { setListRolesResponseGetRolesAttributeType(&o.Roles, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ListRolesResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getListRolesResponseGetRolesAttributeTypeOk(o.Roles); ok { @@ -90,37 +106,45 @@ func (o ListRolesResponse) 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 NullableListRolesResponse struct { value *ListRolesResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableListRolesResponse) Get() *ListRolesResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableListRolesResponse) Set(val *ListRolesResponse) { 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 NullableListRolesResponse) 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 *NullableListRolesResponse) 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 NewNullableListRolesResponse(val *ListRolesResponse) *NullableListRolesResponse { return &NullableListRolesResponse{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 NullableListRolesResponse) 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 *NullableListRolesResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/sqlserverflex/model_list_storages_response.go b/services/sqlserverflex/model_list_storages_response.go index 2b7b56caa..25dd519b6 100644 --- a/services/sqlserverflex/model_list_storages_response.go +++ b/services/sqlserverflex/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 sqlserverflex 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/sqlserverflex/model_list_users_response.go b/services/sqlserverflex/model_list_users_response.go index cbbdcd1d0..b3ea6ebff 100644 --- a/services/sqlserverflex/model_list_users_response.go +++ b/services/sqlserverflex/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 sqlserverflex 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 = *[]InstanceListUser + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListUsersResponseGetItemsArgType = []InstanceListUser + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListUsersResponseGetItemsRetType = []InstanceListUser +// 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 []InstanceListUser 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/sqlserverflex/model_list_versions_response.go b/services/sqlserverflex/model_list_versions_response.go index 825316d04..d0db96eae 100644 --- a/services/sqlserverflex/model_list_versions_response.go +++ b/services/sqlserverflex/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 sqlserverflex 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/sqlserverflex/model_mssql_database_collation.go b/services/sqlserverflex/model_mssql_database_collation.go index 5b7759f6e..1a142978a 100644 --- a/services/sqlserverflex/model_mssql_database_collation.go +++ b/services/sqlserverflex/model_mssql_database_collation.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 sqlserverflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &MssqlDatabaseCollation{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MssqlDatabaseCollationGetCollationNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getMssqlDatabaseCollationGetCollationNameAttributeTypeOk(arg MssqlDatabaseCollationGetCollationNameAttributeType) (ret MssqlDatabaseCollationGetCollationNameRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getMssqlDatabaseCollationGetCollationNameAttributeTypeOk(arg MssqlDatabaseC return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setMssqlDatabaseCollationGetCollationNameAttributeType(arg *MssqlDatabaseCollationGetCollationNameAttributeType, val MssqlDatabaseCollationGetCollationNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MssqlDatabaseCollationGetCollationNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MssqlDatabaseCollationGetCollationNameRetType = string /* @@ -43,8 +50,10 @@ type MssqlDatabaseCollationGetCollationNameRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MssqlDatabaseCollationGetDescriptionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getMssqlDatabaseCollationGetDescriptionAttributeTypeOk(arg MssqlDatabaseCollationGetDescriptionAttributeType) (ret MssqlDatabaseCollationGetDescriptionRetType, ok bool) { if arg == nil { return ret, false @@ -52,14 +61,19 @@ func getMssqlDatabaseCollationGetDescriptionAttributeTypeOk(arg MssqlDatabaseCol return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setMssqlDatabaseCollationGetDescriptionAttributeType(arg *MssqlDatabaseCollationGetDescriptionAttributeType, val MssqlDatabaseCollationGetDescriptionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MssqlDatabaseCollationGetDescriptionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MssqlDatabaseCollationGetDescriptionRetType = string // MssqlDatabaseCollation struct for MssqlDatabaseCollation +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MssqlDatabaseCollation struct { CollationName MssqlDatabaseCollationGetCollationNameAttributeType `json:"collation_name,omitempty"` Description MssqlDatabaseCollationGetDescriptionAttributeType `json:"description,omitempty"` @@ -69,6 +83,7 @@ type MssqlDatabaseCollation 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 NewMssqlDatabaseCollation() *MssqlDatabaseCollation { this := MssqlDatabaseCollation{} return &this @@ -77,12 +92,14 @@ func NewMssqlDatabaseCollation() *MssqlDatabaseCollation { // NewMssqlDatabaseCollationWithDefaults instantiates a new MssqlDatabaseCollation object // This 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 NewMssqlDatabaseCollationWithDefaults() *MssqlDatabaseCollation { this := MssqlDatabaseCollation{} return &this } // GetCollationName returns the CollationName field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *MssqlDatabaseCollation) GetCollationName() (res MssqlDatabaseCollationGetCollationNameRetType) { res, _ = o.GetCollationNameOk() return @@ -90,22 +107,26 @@ func (o *MssqlDatabaseCollation) GetCollationName() (res MssqlDatabaseCollationG // GetCollationNameOk returns a tuple with the CollationName field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *MssqlDatabaseCollation) GetCollationNameOk() (ret MssqlDatabaseCollationGetCollationNameRetType, ok bool) { return getMssqlDatabaseCollationGetCollationNameAttributeTypeOk(o.CollationName) } // HasCollationName returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *MssqlDatabaseCollation) HasCollationName() bool { _, ok := o.GetCollationNameOk() return ok } // SetCollationName gets a reference to the given string and assigns it to the CollationName field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *MssqlDatabaseCollation) SetCollationName(v MssqlDatabaseCollationGetCollationNameRetType) { setMssqlDatabaseCollationGetCollationNameAttributeType(&o.CollationName, 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 *MssqlDatabaseCollation) GetDescription() (res MssqlDatabaseCollationGetDescriptionRetType) { res, _ = o.GetDescriptionOk() return @@ -113,21 +134,25 @@ func (o *MssqlDatabaseCollation) GetDescription() (res MssqlDatabaseCollationGet // 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 *MssqlDatabaseCollation) GetDescriptionOk() (ret MssqlDatabaseCollationGetDescriptionRetType, ok bool) { return getMssqlDatabaseCollationGetDescriptionAttributeTypeOk(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 *MssqlDatabaseCollation) 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 *MssqlDatabaseCollation) SetDescription(v MssqlDatabaseCollationGetDescriptionRetType) { setMssqlDatabaseCollationGetDescriptionAttributeType(&o.Description, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o MssqlDatabaseCollation) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getMssqlDatabaseCollationGetCollationNameAttributeTypeOk(o.CollationName); ok { @@ -139,37 +164,45 @@ func (o MssqlDatabaseCollation) 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 NullableMssqlDatabaseCollation struct { value *MssqlDatabaseCollation isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableMssqlDatabaseCollation) Get() *MssqlDatabaseCollation { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableMssqlDatabaseCollation) Set(val *MssqlDatabaseCollation) { 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 NullableMssqlDatabaseCollation) 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 *NullableMssqlDatabaseCollation) 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 NewNullableMssqlDatabaseCollation(val *MssqlDatabaseCollation) *NullableMssqlDatabaseCollation { return &NullableMssqlDatabaseCollation{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 NullableMssqlDatabaseCollation) 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 *NullableMssqlDatabaseCollation) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/sqlserverflex/model_mssql_database_compatibility.go b/services/sqlserverflex/model_mssql_database_compatibility.go index e7a07972b..3a400ab37 100644 --- a/services/sqlserverflex/model_mssql_database_compatibility.go +++ b/services/sqlserverflex/model_mssql_database_compatibility.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 sqlserverflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &MssqlDatabaseCompatibility{} */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MssqlDatabaseCompatibilityGetCompatibilityLevelAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MssqlDatabaseCompatibilityGetCompatibilityLevelArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MssqlDatabaseCompatibilityGetCompatibilityLevelRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getMssqlDatabaseCompatibilityGetCompatibilityLevelAttributeTypeOk(arg MssqlDatabaseCompatibilityGetCompatibilityLevelAttributeType) (ret MssqlDatabaseCompatibilityGetCompatibilityLevelRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getMssqlDatabaseCompatibilityGetCompatibilityLevelAttributeTypeOk(arg Mssql return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setMssqlDatabaseCompatibilityGetCompatibilityLevelAttributeType(arg *MssqlDatabaseCompatibilityGetCompatibilityLevelAttributeType, val MssqlDatabaseCompatibilityGetCompatibilityLevelRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setMssqlDatabaseCompatibilityGetCompatibilityLevelAttributeType(arg *MssqlD */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MssqlDatabaseCompatibilityGetDescriptionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getMssqlDatabaseCompatibilityGetDescriptionAttributeTypeOk(arg MssqlDatabaseCompatibilityGetDescriptionAttributeType) (ret MssqlDatabaseCompatibilityGetDescriptionRetType, ok bool) { if arg == nil { return ret, false @@ -51,14 +61,19 @@ func getMssqlDatabaseCompatibilityGetDescriptionAttributeTypeOk(arg MssqlDatabas return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setMssqlDatabaseCompatibilityGetDescriptionAttributeType(arg *MssqlDatabaseCompatibilityGetDescriptionAttributeType, val MssqlDatabaseCompatibilityGetDescriptionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MssqlDatabaseCompatibilityGetDescriptionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MssqlDatabaseCompatibilityGetDescriptionRetType = string // MssqlDatabaseCompatibility struct for MssqlDatabaseCompatibility +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MssqlDatabaseCompatibility struct { CompatibilityLevel MssqlDatabaseCompatibilityGetCompatibilityLevelAttributeType `json:"compatibility_level,omitempty"` Description MssqlDatabaseCompatibilityGetDescriptionAttributeType `json:"description,omitempty"` @@ -68,6 +83,7 @@ type MssqlDatabaseCompatibility 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 NewMssqlDatabaseCompatibility() *MssqlDatabaseCompatibility { this := MssqlDatabaseCompatibility{} return &this @@ -76,12 +92,14 @@ func NewMssqlDatabaseCompatibility() *MssqlDatabaseCompatibility { // NewMssqlDatabaseCompatibilityWithDefaults instantiates a new MssqlDatabaseCompatibility object // This 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 NewMssqlDatabaseCompatibilityWithDefaults() *MssqlDatabaseCompatibility { this := MssqlDatabaseCompatibility{} return &this } // GetCompatibilityLevel returns the CompatibilityLevel field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *MssqlDatabaseCompatibility) GetCompatibilityLevel() (res MssqlDatabaseCompatibilityGetCompatibilityLevelRetType) { res, _ = o.GetCompatibilityLevelOk() return @@ -89,22 +107,26 @@ func (o *MssqlDatabaseCompatibility) GetCompatibilityLevel() (res MssqlDatabaseC // GetCompatibilityLevelOk returns a tuple with the CompatibilityLevel field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *MssqlDatabaseCompatibility) GetCompatibilityLevelOk() (ret MssqlDatabaseCompatibilityGetCompatibilityLevelRetType, ok bool) { return getMssqlDatabaseCompatibilityGetCompatibilityLevelAttributeTypeOk(o.CompatibilityLevel) } // HasCompatibilityLevel returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *MssqlDatabaseCompatibility) HasCompatibilityLevel() bool { _, ok := o.GetCompatibilityLevelOk() return ok } // SetCompatibilityLevel gets a reference to the given int64 and assigns it to the CompatibilityLevel field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *MssqlDatabaseCompatibility) SetCompatibilityLevel(v MssqlDatabaseCompatibilityGetCompatibilityLevelRetType) { setMssqlDatabaseCompatibilityGetCompatibilityLevelAttributeType(&o.CompatibilityLevel, 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 *MssqlDatabaseCompatibility) GetDescription() (res MssqlDatabaseCompatibilityGetDescriptionRetType) { res, _ = o.GetDescriptionOk() return @@ -112,21 +134,25 @@ func (o *MssqlDatabaseCompatibility) GetDescription() (res MssqlDatabaseCompatib // 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 *MssqlDatabaseCompatibility) GetDescriptionOk() (ret MssqlDatabaseCompatibilityGetDescriptionRetType, ok bool) { return getMssqlDatabaseCompatibilityGetDescriptionAttributeTypeOk(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 *MssqlDatabaseCompatibility) 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 *MssqlDatabaseCompatibility) SetDescription(v MssqlDatabaseCompatibilityGetDescriptionRetType) { setMssqlDatabaseCompatibilityGetDescriptionAttributeType(&o.Description, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o MssqlDatabaseCompatibility) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getMssqlDatabaseCompatibilityGetCompatibilityLevelAttributeTypeOk(o.CompatibilityLevel); ok { @@ -138,37 +164,45 @@ func (o MssqlDatabaseCompatibility) 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 NullableMssqlDatabaseCompatibility struct { value *MssqlDatabaseCompatibility isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableMssqlDatabaseCompatibility) Get() *MssqlDatabaseCompatibility { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableMssqlDatabaseCompatibility) Set(val *MssqlDatabaseCompatibility) { 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 NullableMssqlDatabaseCompatibility) 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 *NullableMssqlDatabaseCompatibility) 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 NewNullableMssqlDatabaseCompatibility(val *MssqlDatabaseCompatibility) *NullableMssqlDatabaseCompatibility { return &NullableMssqlDatabaseCompatibility{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 NullableMssqlDatabaseCompatibility) 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 *NullableMssqlDatabaseCompatibility) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/sqlserverflex/model_partial_update_instance_payload.go b/services/sqlserverflex/model_partial_update_instance_payload.go index 4f8443d6b..c7347069e 100644 --- a/services/sqlserverflex/model_partial_update_instance_payload.go +++ b/services/sqlserverflex/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 sqlserverflex 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 = *CreateInstancePayloadAcl + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateInstancePayloadGetAclArgType = CreateInstancePayloadAcl + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateInstancePayloadGetAclRetType = CreateInstancePayloadAcl +// 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 */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateInstancePayloadGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateInstancePayloadGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateInstancePayloadGetLabelsRetType = map[string]interface{} +// 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,8 +158,10 @@ type PartialUpdateInstancePayloadGetNameRetType = string */ // 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 @@ -134,14 +169,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"` // Cronjob for the daily full backup if not provided a job will generated between 00:00 and 04:59 @@ -159,6 +199,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 @@ -167,6 +208,7 @@ 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{} var version string = "2022" @@ -175,6 +217,7 @@ func NewPartialUpdateInstancePayloadWithDefaults() *PartialUpdateInstancePayload } // 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 @@ -182,22 +225,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 CreateInstancePayloadAcl 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 @@ -205,22 +252,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 @@ -228,22 +279,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 @@ -251,22 +306,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]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *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 @@ -274,22 +333,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) } // 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 @@ -297,21 +360,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 { @@ -335,37 +402,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/sqlserverflex/model_reset_user_response.go b/services/sqlserverflex/model_reset_user_response.go index d17c8d310..256e8888d 100644 --- a/services/sqlserverflex/model_reset_user_response.go +++ b/services/sqlserverflex/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 sqlserverflex 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 = *SingleUser + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ResetUserResponseGetItemArgType = SingleUser + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ResetUserResponseGetItemRetType = SingleUser +// 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 SingleUser 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/sqlserverflex/model_restore_running_restore.go b/services/sqlserverflex/model_restore_running_restore.go index 40b717c79..9587c8518 100644 --- a/services/sqlserverflex/model_restore_running_restore.go +++ b/services/sqlserverflex/model_restore_running_restore.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 sqlserverflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &RestoreRunningRestore{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RestoreRunningRestoreGetCommandAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRestoreRunningRestoreGetCommandAttributeTypeOk(arg RestoreRunningRestoreGetCommandAttributeType) (ret RestoreRunningRestoreGetCommandRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getRestoreRunningRestoreGetCommandAttributeTypeOk(arg RestoreRunningRestore return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRestoreRunningRestoreGetCommandAttributeType(arg *RestoreRunningRestoreGetCommandAttributeType, val RestoreRunningRestoreGetCommandRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RestoreRunningRestoreGetCommandArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RestoreRunningRestoreGetCommandRetType = string /* @@ -43,8 +50,10 @@ type RestoreRunningRestoreGetCommandRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RestoreRunningRestoreGetDatabaseNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRestoreRunningRestoreGetDatabaseNameAttributeTypeOk(arg RestoreRunningRestoreGetDatabaseNameAttributeType) (ret RestoreRunningRestoreGetDatabaseNameRetType, ok bool) { if arg == nil { return ret, false @@ -52,11 +61,15 @@ func getRestoreRunningRestoreGetDatabaseNameAttributeTypeOk(arg RestoreRunningRe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRestoreRunningRestoreGetDatabaseNameAttributeType(arg *RestoreRunningRestoreGetDatabaseNameAttributeType, val RestoreRunningRestoreGetDatabaseNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RestoreRunningRestoreGetDatabaseNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RestoreRunningRestoreGetDatabaseNameRetType = string /* @@ -64,8 +77,10 @@ type RestoreRunningRestoreGetDatabaseNameRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RestoreRunningRestoreGetEstimatedCompletionTimeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRestoreRunningRestoreGetEstimatedCompletionTimeAttributeTypeOk(arg RestoreRunningRestoreGetEstimatedCompletionTimeAttributeType) (ret RestoreRunningRestoreGetEstimatedCompletionTimeRetType, ok bool) { if arg == nil { return ret, false @@ -73,11 +88,15 @@ func getRestoreRunningRestoreGetEstimatedCompletionTimeAttributeTypeOk(arg Resto return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRestoreRunningRestoreGetEstimatedCompletionTimeAttributeType(arg *RestoreRunningRestoreGetEstimatedCompletionTimeAttributeType, val RestoreRunningRestoreGetEstimatedCompletionTimeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RestoreRunningRestoreGetEstimatedCompletionTimeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RestoreRunningRestoreGetEstimatedCompletionTimeRetType = string /* @@ -85,10 +104,16 @@ type RestoreRunningRestoreGetEstimatedCompletionTimeRetType = string */ // isInteger +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RestoreRunningRestoreGetPercentCompleteAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RestoreRunningRestoreGetPercentCompleteArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RestoreRunningRestoreGetPercentCompleteRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRestoreRunningRestoreGetPercentCompleteAttributeTypeOk(arg RestoreRunningRestoreGetPercentCompleteAttributeType) (ret RestoreRunningRestoreGetPercentCompleteRetType, ok bool) { if arg == nil { return ret, false @@ -96,6 +121,7 @@ func getRestoreRunningRestoreGetPercentCompleteAttributeTypeOk(arg RestoreRunnin return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRestoreRunningRestoreGetPercentCompleteAttributeType(arg *RestoreRunningRestoreGetPercentCompleteAttributeType, val RestoreRunningRestoreGetPercentCompleteRetType) { *arg = &val } @@ -105,8 +131,10 @@ func setRestoreRunningRestoreGetPercentCompleteAttributeType(arg *RestoreRunning */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RestoreRunningRestoreGetStartTimeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRestoreRunningRestoreGetStartTimeAttributeTypeOk(arg RestoreRunningRestoreGetStartTimeAttributeType) (ret RestoreRunningRestoreGetStartTimeRetType, ok bool) { if arg == nil { return ret, false @@ -114,14 +142,19 @@ func getRestoreRunningRestoreGetStartTimeAttributeTypeOk(arg RestoreRunningResto return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRestoreRunningRestoreGetStartTimeAttributeType(arg *RestoreRunningRestoreGetStartTimeAttributeType, val RestoreRunningRestoreGetStartTimeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RestoreRunningRestoreGetStartTimeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RestoreRunningRestoreGetStartTimeRetType = string // RestoreRunningRestore struct for RestoreRunningRestore +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RestoreRunningRestore struct { Command RestoreRunningRestoreGetCommandAttributeType `json:"command,omitempty"` DatabaseName RestoreRunningRestoreGetDatabaseNameAttributeType `json:"database_name,omitempty"` @@ -135,6 +168,7 @@ type RestoreRunningRestore 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 NewRestoreRunningRestore() *RestoreRunningRestore { this := RestoreRunningRestore{} return &this @@ -143,12 +177,14 @@ func NewRestoreRunningRestore() *RestoreRunningRestore { // NewRestoreRunningRestoreWithDefaults instantiates a new RestoreRunningRestore object // This 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 NewRestoreRunningRestoreWithDefaults() *RestoreRunningRestore { this := RestoreRunningRestore{} return &this } // GetCommand returns the Command field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RestoreRunningRestore) GetCommand() (res RestoreRunningRestoreGetCommandRetType) { res, _ = o.GetCommandOk() return @@ -156,22 +192,26 @@ func (o *RestoreRunningRestore) GetCommand() (res RestoreRunningRestoreGetComman // GetCommandOk returns a tuple with the Command field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RestoreRunningRestore) GetCommandOk() (ret RestoreRunningRestoreGetCommandRetType, ok bool) { return getRestoreRunningRestoreGetCommandAttributeTypeOk(o.Command) } // HasCommand returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RestoreRunningRestore) HasCommand() bool { _, ok := o.GetCommandOk() return ok } // SetCommand gets a reference to the given string and assigns it to the Command field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RestoreRunningRestore) SetCommand(v RestoreRunningRestoreGetCommandRetType) { setRestoreRunningRestoreGetCommandAttributeType(&o.Command, v) } // GetDatabaseName returns the DatabaseName field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RestoreRunningRestore) GetDatabaseName() (res RestoreRunningRestoreGetDatabaseNameRetType) { res, _ = o.GetDatabaseNameOk() return @@ -179,22 +219,26 @@ func (o *RestoreRunningRestore) GetDatabaseName() (res RestoreRunningRestoreGetD // GetDatabaseNameOk returns a tuple with the DatabaseName field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RestoreRunningRestore) GetDatabaseNameOk() (ret RestoreRunningRestoreGetDatabaseNameRetType, ok bool) { return getRestoreRunningRestoreGetDatabaseNameAttributeTypeOk(o.DatabaseName) } // HasDatabaseName returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RestoreRunningRestore) HasDatabaseName() bool { _, ok := o.GetDatabaseNameOk() return ok } // SetDatabaseName gets a reference to the given string and assigns it to the DatabaseName field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RestoreRunningRestore) SetDatabaseName(v RestoreRunningRestoreGetDatabaseNameRetType) { setRestoreRunningRestoreGetDatabaseNameAttributeType(&o.DatabaseName, v) } // GetEstimatedCompletionTime returns the EstimatedCompletionTime field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RestoreRunningRestore) GetEstimatedCompletionTime() (res RestoreRunningRestoreGetEstimatedCompletionTimeRetType) { res, _ = o.GetEstimatedCompletionTimeOk() return @@ -202,22 +246,26 @@ func (o *RestoreRunningRestore) GetEstimatedCompletionTime() (res RestoreRunning // GetEstimatedCompletionTimeOk returns a tuple with the EstimatedCompletionTime field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RestoreRunningRestore) GetEstimatedCompletionTimeOk() (ret RestoreRunningRestoreGetEstimatedCompletionTimeRetType, ok bool) { return getRestoreRunningRestoreGetEstimatedCompletionTimeAttributeTypeOk(o.EstimatedCompletionTime) } // HasEstimatedCompletionTime returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RestoreRunningRestore) HasEstimatedCompletionTime() bool { _, ok := o.GetEstimatedCompletionTimeOk() return ok } // SetEstimatedCompletionTime gets a reference to the given string and assigns it to the EstimatedCompletionTime field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RestoreRunningRestore) SetEstimatedCompletionTime(v RestoreRunningRestoreGetEstimatedCompletionTimeRetType) { setRestoreRunningRestoreGetEstimatedCompletionTimeAttributeType(&o.EstimatedCompletionTime, v) } // GetPercentComplete returns the PercentComplete field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RestoreRunningRestore) GetPercentComplete() (res RestoreRunningRestoreGetPercentCompleteRetType) { res, _ = o.GetPercentCompleteOk() return @@ -225,22 +273,26 @@ func (o *RestoreRunningRestore) GetPercentComplete() (res RestoreRunningRestoreG // GetPercentCompleteOk returns a tuple with the PercentComplete field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RestoreRunningRestore) GetPercentCompleteOk() (ret RestoreRunningRestoreGetPercentCompleteRetType, ok bool) { return getRestoreRunningRestoreGetPercentCompleteAttributeTypeOk(o.PercentComplete) } // HasPercentComplete returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RestoreRunningRestore) HasPercentComplete() bool { _, ok := o.GetPercentCompleteOk() return ok } // SetPercentComplete gets a reference to the given int64 and assigns it to the PercentComplete field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RestoreRunningRestore) SetPercentComplete(v RestoreRunningRestoreGetPercentCompleteRetType) { setRestoreRunningRestoreGetPercentCompleteAttributeType(&o.PercentComplete, 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 *RestoreRunningRestore) GetStartTime() (res RestoreRunningRestoreGetStartTimeRetType) { res, _ = o.GetStartTimeOk() return @@ -248,21 +300,25 @@ func (o *RestoreRunningRestore) GetStartTime() (res RestoreRunningRestoreGetStar // 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 *RestoreRunningRestore) GetStartTimeOk() (ret RestoreRunningRestoreGetStartTimeRetType, ok bool) { return getRestoreRunningRestoreGetStartTimeAttributeTypeOk(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 *RestoreRunningRestore) 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 *RestoreRunningRestore) SetStartTime(v RestoreRunningRestoreGetStartTimeRetType) { setRestoreRunningRestoreGetStartTimeAttributeType(&o.StartTime, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o RestoreRunningRestore) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getRestoreRunningRestoreGetCommandAttributeTypeOk(o.Command); ok { @@ -283,37 +339,45 @@ func (o RestoreRunningRestore) 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 NullableRestoreRunningRestore struct { value *RestoreRunningRestore isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRestoreRunningRestore) Get() *RestoreRunningRestore { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRestoreRunningRestore) Set(val *RestoreRunningRestore) { 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 NullableRestoreRunningRestore) 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 *NullableRestoreRunningRestore) 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 NewNullableRestoreRunningRestore(val *RestoreRunningRestore) *NullableRestoreRunningRestore { return &NullableRestoreRunningRestore{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 NullableRestoreRunningRestore) 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 *NullableRestoreRunningRestore) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/sqlserverflex/model_single_database.go b/services/sqlserverflex/model_single_database.go index 3b1d02e06..f356b62c1 100644 --- a/services/sqlserverflex/model_single_database.go +++ b/services/sqlserverflex/model_single_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 sqlserverflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &SingleDatabase{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleDatabaseGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSingleDatabaseGetIdAttributeTypeOk(arg SingleDatabaseGetIdAttributeType) (ret SingleDatabaseGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getSingleDatabaseGetIdAttributeTypeOk(arg SingleDatabaseGetIdAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSingleDatabaseGetIdAttributeType(arg *SingleDatabaseGetIdAttributeType, val SingleDatabaseGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleDatabaseGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleDatabaseGetIdRetType = string /* @@ -43,8 +50,10 @@ type SingleDatabaseGetIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleDatabaseGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSingleDatabaseGetNameAttributeTypeOk(arg SingleDatabaseGetNameAttributeType) (ret SingleDatabaseGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -52,11 +61,15 @@ func getSingleDatabaseGetNameAttributeTypeOk(arg SingleDatabaseGetNameAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSingleDatabaseGetNameAttributeType(arg *SingleDatabaseGetNameAttributeType, val SingleDatabaseGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleDatabaseGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleDatabaseGetNameRetType = string /* @@ -64,10 +77,16 @@ type SingleDatabaseGetNameRetType = string */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleDatabaseGetOptionsAttributeType = *SingleDatabaseOptions + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleDatabaseGetOptionsArgType = SingleDatabaseOptions + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleDatabaseGetOptionsRetType = SingleDatabaseOptions +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSingleDatabaseGetOptionsAttributeTypeOk(arg SingleDatabaseGetOptionsAttributeType) (ret SingleDatabaseGetOptionsRetType, ok bool) { if arg == nil { return ret, false @@ -75,11 +94,13 @@ func getSingleDatabaseGetOptionsAttributeTypeOk(arg SingleDatabaseGetOptionsAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSingleDatabaseGetOptionsAttributeType(arg *SingleDatabaseGetOptionsAttributeType, val SingleDatabaseGetOptionsRetType) { *arg = &val } // SingleDatabase struct for SingleDatabase +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleDatabase struct { // Database id Id SingleDatabaseGetIdAttributeType `json:"id,omitempty"` @@ -92,6 +113,7 @@ type SingleDatabase 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 NewSingleDatabase() *SingleDatabase { this := SingleDatabase{} return &this @@ -100,12 +122,14 @@ func NewSingleDatabase() *SingleDatabase { // NewSingleDatabaseWithDefaults instantiates a new SingleDatabase object // This 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 NewSingleDatabaseWithDefaults() *SingleDatabase { this := SingleDatabase{} 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 *SingleDatabase) GetId() (res SingleDatabaseGetIdRetType) { res, _ = o.GetIdOk() return @@ -113,22 +137,26 @@ func (o *SingleDatabase) GetId() (res SingleDatabaseGetIdRetType) { // 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 *SingleDatabase) GetIdOk() (ret SingleDatabaseGetIdRetType, ok bool) { return getSingleDatabaseGetIdAttributeTypeOk(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 *SingleDatabase) 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 *SingleDatabase) SetId(v SingleDatabaseGetIdRetType) { setSingleDatabaseGetIdAttributeType(&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 *SingleDatabase) GetName() (res SingleDatabaseGetNameRetType) { res, _ = o.GetNameOk() return @@ -136,22 +164,26 @@ func (o *SingleDatabase) GetName() (res SingleDatabaseGetNameRetType) { // 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 *SingleDatabase) GetNameOk() (ret SingleDatabaseGetNameRetType, ok bool) { return getSingleDatabaseGetNameAttributeTypeOk(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 *SingleDatabase) 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 *SingleDatabase) SetName(v SingleDatabaseGetNameRetType) { setSingleDatabaseGetNameAttributeType(&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 *SingleDatabase) GetOptions() (res SingleDatabaseGetOptionsRetType) { res, _ = o.GetOptionsOk() return @@ -159,21 +191,25 @@ func (o *SingleDatabase) GetOptions() (res SingleDatabaseGetOptionsRetType) { // 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 *SingleDatabase) GetOptionsOk() (ret SingleDatabaseGetOptionsRetType, ok bool) { return getSingleDatabaseGetOptionsAttributeTypeOk(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 *SingleDatabase) HasOptions() bool { _, ok := o.GetOptionsOk() return ok } // SetOptions gets a reference to the given SingleDatabaseOptions 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 *SingleDatabase) SetOptions(v SingleDatabaseGetOptionsRetType) { setSingleDatabaseGetOptionsAttributeType(&o.Options, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o SingleDatabase) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getSingleDatabaseGetIdAttributeTypeOk(o.Id); ok { @@ -188,37 +224,45 @@ func (o SingleDatabase) 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 NullableSingleDatabase struct { value *SingleDatabase isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableSingleDatabase) Get() *SingleDatabase { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableSingleDatabase) Set(val *SingleDatabase) { 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 NullableSingleDatabase) 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 *NullableSingleDatabase) 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 NewNullableSingleDatabase(val *SingleDatabase) *NullableSingleDatabase { return &NullableSingleDatabase{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 NullableSingleDatabase) 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 *NullableSingleDatabase) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/sqlserverflex/model_single_database_options.go b/services/sqlserverflex/model_single_database_options.go index 01f18aa33..0b6a9b301 100644 --- a/services/sqlserverflex/model_single_database_options.go +++ b/services/sqlserverflex/model_single_database_options.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 sqlserverflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &SingleDatabaseOptions{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleDatabaseOptionsGetCollationNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSingleDatabaseOptionsGetCollationNameAttributeTypeOk(arg SingleDatabaseOptionsGetCollationNameAttributeType) (ret SingleDatabaseOptionsGetCollationNameRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getSingleDatabaseOptionsGetCollationNameAttributeTypeOk(arg SingleDatabaseO return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSingleDatabaseOptionsGetCollationNameAttributeType(arg *SingleDatabaseOptionsGetCollationNameAttributeType, val SingleDatabaseOptionsGetCollationNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleDatabaseOptionsGetCollationNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleDatabaseOptionsGetCollationNameRetType = string /* @@ -43,10 +50,16 @@ type SingleDatabaseOptionsGetCollationNameRetType = string */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleDatabaseOptionsGetCompatibilityLevelAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleDatabaseOptionsGetCompatibilityLevelArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleDatabaseOptionsGetCompatibilityLevelRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSingleDatabaseOptionsGetCompatibilityLevelAttributeTypeOk(arg SingleDatabaseOptionsGetCompatibilityLevelAttributeType) (ret SingleDatabaseOptionsGetCompatibilityLevelRetType, ok bool) { if arg == nil { return ret, false @@ -54,6 +67,7 @@ func getSingleDatabaseOptionsGetCompatibilityLevelAttributeTypeOk(arg SingleData return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSingleDatabaseOptionsGetCompatibilityLevelAttributeType(arg *SingleDatabaseOptionsGetCompatibilityLevelAttributeType, val SingleDatabaseOptionsGetCompatibilityLevelRetType) { *arg = &val } @@ -63,8 +77,10 @@ func setSingleDatabaseOptionsGetCompatibilityLevelAttributeType(arg *SingleDatab */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleDatabaseOptionsGetOwnerAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSingleDatabaseOptionsGetOwnerAttributeTypeOk(arg SingleDatabaseOptionsGetOwnerAttributeType) (ret SingleDatabaseOptionsGetOwnerRetType, ok bool) { if arg == nil { return ret, false @@ -72,14 +88,19 @@ func getSingleDatabaseOptionsGetOwnerAttributeTypeOk(arg SingleDatabaseOptionsGe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSingleDatabaseOptionsGetOwnerAttributeType(arg *SingleDatabaseOptionsGetOwnerAttributeType, val SingleDatabaseOptionsGetOwnerRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleDatabaseOptionsGetOwnerArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleDatabaseOptionsGetOwnerRetType = string // SingleDatabaseOptions Database specific options +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleDatabaseOptions struct { // Name of the collation of the database CollationName SingleDatabaseOptionsGetCollationNameAttributeType `json:"collationName,omitempty"` @@ -93,6 +114,7 @@ type SingleDatabaseOptions 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 NewSingleDatabaseOptions() *SingleDatabaseOptions { this := SingleDatabaseOptions{} return &this @@ -101,12 +123,14 @@ func NewSingleDatabaseOptions() *SingleDatabaseOptions { // NewSingleDatabaseOptionsWithDefaults instantiates a new SingleDatabaseOptions object // This 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 NewSingleDatabaseOptionsWithDefaults() *SingleDatabaseOptions { this := SingleDatabaseOptions{} return &this } // GetCollationName returns the CollationName field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SingleDatabaseOptions) GetCollationName() (res SingleDatabaseOptionsGetCollationNameRetType) { res, _ = o.GetCollationNameOk() return @@ -114,22 +138,26 @@ func (o *SingleDatabaseOptions) GetCollationName() (res SingleDatabaseOptionsGet // GetCollationNameOk returns a tuple with the CollationName field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SingleDatabaseOptions) GetCollationNameOk() (ret SingleDatabaseOptionsGetCollationNameRetType, ok bool) { return getSingleDatabaseOptionsGetCollationNameAttributeTypeOk(o.CollationName) } // HasCollationName returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SingleDatabaseOptions) HasCollationName() bool { _, ok := o.GetCollationNameOk() return ok } // SetCollationName gets a reference to the given string and assigns it to the CollationName field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SingleDatabaseOptions) SetCollationName(v SingleDatabaseOptionsGetCollationNameRetType) { setSingleDatabaseOptionsGetCollationNameAttributeType(&o.CollationName, v) } // GetCompatibilityLevel returns the CompatibilityLevel field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SingleDatabaseOptions) GetCompatibilityLevel() (res SingleDatabaseOptionsGetCompatibilityLevelRetType) { res, _ = o.GetCompatibilityLevelOk() return @@ -137,22 +165,26 @@ func (o *SingleDatabaseOptions) GetCompatibilityLevel() (res SingleDatabaseOptio // GetCompatibilityLevelOk returns a tuple with the CompatibilityLevel field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SingleDatabaseOptions) GetCompatibilityLevelOk() (ret SingleDatabaseOptionsGetCompatibilityLevelRetType, ok bool) { return getSingleDatabaseOptionsGetCompatibilityLevelAttributeTypeOk(o.CompatibilityLevel) } // HasCompatibilityLevel returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SingleDatabaseOptions) HasCompatibilityLevel() bool { _, ok := o.GetCompatibilityLevelOk() return ok } // SetCompatibilityLevel gets a reference to the given int64 and assigns it to the CompatibilityLevel field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SingleDatabaseOptions) SetCompatibilityLevel(v SingleDatabaseOptionsGetCompatibilityLevelRetType) { setSingleDatabaseOptionsGetCompatibilityLevelAttributeType(&o.CompatibilityLevel, v) } // GetOwner returns the Owner field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SingleDatabaseOptions) GetOwner() (res SingleDatabaseOptionsGetOwnerRetType) { res, _ = o.GetOwnerOk() return @@ -160,21 +192,25 @@ func (o *SingleDatabaseOptions) GetOwner() (res SingleDatabaseOptionsGetOwnerRet // GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SingleDatabaseOptions) GetOwnerOk() (ret SingleDatabaseOptionsGetOwnerRetType, ok bool) { return getSingleDatabaseOptionsGetOwnerAttributeTypeOk(o.Owner) } // HasOwner returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SingleDatabaseOptions) HasOwner() bool { _, ok := o.GetOwnerOk() return ok } // SetOwner gets a reference to the given string and assigns it to the Owner field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SingleDatabaseOptions) SetOwner(v SingleDatabaseOptionsGetOwnerRetType) { setSingleDatabaseOptionsGetOwnerAttributeType(&o.Owner, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o SingleDatabaseOptions) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getSingleDatabaseOptionsGetCollationNameAttributeTypeOk(o.CollationName); ok { @@ -189,37 +225,45 @@ func (o SingleDatabaseOptions) 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 NullableSingleDatabaseOptions struct { value *SingleDatabaseOptions isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableSingleDatabaseOptions) Get() *SingleDatabaseOptions { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableSingleDatabaseOptions) Set(val *SingleDatabaseOptions) { 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 NullableSingleDatabaseOptions) 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 *NullableSingleDatabaseOptions) 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 NewNullableSingleDatabaseOptions(val *SingleDatabaseOptions) *NullableSingleDatabaseOptions { return &NullableSingleDatabaseOptions{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 NullableSingleDatabaseOptions) 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 *NullableSingleDatabaseOptions) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/sqlserverflex/model_single_user.go b/services/sqlserverflex/model_single_user.go index 44ef867c3..2afa35ee3 100644 --- a/services/sqlserverflex/model_single_user.go +++ b/services/sqlserverflex/model_single_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 sqlserverflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &SingleUser{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleUserGetDefaultDatabaseAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSingleUserGetDefaultDatabaseAttributeTypeOk(arg SingleUserGetDefaultDatabaseAttributeType) (ret SingleUserGetDefaultDatabaseRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getSingleUserGetDefaultDatabaseAttributeTypeOk(arg SingleUserGetDefaultData return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSingleUserGetDefaultDatabaseAttributeType(arg *SingleUserGetDefaultDatabaseAttributeType, val SingleUserGetDefaultDatabaseRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleUserGetDefaultDatabaseArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleUserGetDefaultDatabaseRetType = string /* @@ -43,8 +50,10 @@ type SingleUserGetDefaultDatabaseRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleUserGetHostAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSingleUserGetHostAttributeTypeOk(arg SingleUserGetHostAttributeType) (ret SingleUserGetHostRetType, ok bool) { if arg == nil { return ret, false @@ -52,11 +61,15 @@ func getSingleUserGetHostAttributeTypeOk(arg SingleUserGetHostAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSingleUserGetHostAttributeType(arg *SingleUserGetHostAttributeType, val SingleUserGetHostRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleUserGetHostArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleUserGetHostRetType = string /* @@ -64,8 +77,10 @@ type SingleUserGetHostRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleUserGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSingleUserGetIdAttributeTypeOk(arg SingleUserGetIdAttributeType) (ret SingleUserGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -73,11 +88,15 @@ func getSingleUserGetIdAttributeTypeOk(arg SingleUserGetIdAttributeType) (ret Si return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSingleUserGetIdAttributeType(arg *SingleUserGetIdAttributeType, val SingleUserGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleUserGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleUserGetIdRetType = string /* @@ -85,8 +104,10 @@ type SingleUserGetIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleUserGetPasswordAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSingleUserGetPasswordAttributeTypeOk(arg SingleUserGetPasswordAttributeType) (ret SingleUserGetPasswordRetType, ok bool) { if arg == nil { return ret, false @@ -94,11 +115,15 @@ func getSingleUserGetPasswordAttributeTypeOk(arg SingleUserGetPasswordAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSingleUserGetPasswordAttributeType(arg *SingleUserGetPasswordAttributeType, val SingleUserGetPasswordRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleUserGetPasswordArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleUserGetPasswordRetType = string /* @@ -106,10 +131,16 @@ type SingleUserGetPasswordRetType = string */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleUserGetPortAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleUserGetPortArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleUserGetPortRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSingleUserGetPortAttributeTypeOk(arg SingleUserGetPortAttributeType) (ret SingleUserGetPortRetType, ok bool) { if arg == nil { return ret, false @@ -117,6 +148,7 @@ func getSingleUserGetPortAttributeTypeOk(arg SingleUserGetPortAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSingleUserGetPortAttributeType(arg *SingleUserGetPortAttributeType, val SingleUserGetPortRetType) { *arg = &val } @@ -126,10 +158,16 @@ func setSingleUserGetPortAttributeType(arg *SingleUserGetPortAttributeType, val */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleUserGetRolesAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleUserGetRolesArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleUserGetRolesRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSingleUserGetRolesAttributeTypeOk(arg SingleUserGetRolesAttributeType) (ret SingleUserGetRolesRetType, ok bool) { if arg == nil { return ret, false @@ -137,6 +175,7 @@ func getSingleUserGetRolesAttributeTypeOk(arg SingleUserGetRolesAttributeType) ( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSingleUserGetRolesAttributeType(arg *SingleUserGetRolesAttributeType, val SingleUserGetRolesRetType) { *arg = &val } @@ -146,8 +185,10 @@ func setSingleUserGetRolesAttributeType(arg *SingleUserGetRolesAttributeType, va */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleUserGetUriAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSingleUserGetUriAttributeTypeOk(arg SingleUserGetUriAttributeType) (ret SingleUserGetUriRetType, ok bool) { if arg == nil { return ret, false @@ -155,11 +196,15 @@ func getSingleUserGetUriAttributeTypeOk(arg SingleUserGetUriAttributeType) (ret return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSingleUserGetUriAttributeType(arg *SingleUserGetUriAttributeType, val SingleUserGetUriRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleUserGetUriArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleUserGetUriRetType = string /* @@ -167,8 +212,10 @@ type SingleUserGetUriRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleUserGetUsernameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSingleUserGetUsernameAttributeTypeOk(arg SingleUserGetUsernameAttributeType) (ret SingleUserGetUsernameRetType, ok bool) { if arg == nil { return ret, false @@ -176,14 +223,19 @@ func getSingleUserGetUsernameAttributeTypeOk(arg SingleUserGetUsernameAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSingleUserGetUsernameAttributeType(arg *SingleUserGetUsernameAttributeType, val SingleUserGetUsernameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleUserGetUsernameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleUserGetUsernameRetType = string // SingleUser struct for SingleUser +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SingleUser struct { DefaultDatabase SingleUserGetDefaultDatabaseAttributeType `json:"default_database,omitempty"` Host SingleUserGetHostAttributeType `json:"host,omitempty"` @@ -199,6 +251,7 @@ type SingleUser 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 NewSingleUser() *SingleUser { this := SingleUser{} return &this @@ -207,12 +260,14 @@ func NewSingleUser() *SingleUser { // NewSingleUserWithDefaults instantiates a new SingleUser object // This 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 NewSingleUserWithDefaults() *SingleUser { this := SingleUser{} return &this } // GetDefaultDatabase returns the DefaultDatabase field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SingleUser) GetDefaultDatabase() (res SingleUserGetDefaultDatabaseRetType) { res, _ = o.GetDefaultDatabaseOk() return @@ -220,22 +275,26 @@ func (o *SingleUser) GetDefaultDatabase() (res SingleUserGetDefaultDatabaseRetTy // GetDefaultDatabaseOk returns a tuple with the DefaultDatabase field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SingleUser) GetDefaultDatabaseOk() (ret SingleUserGetDefaultDatabaseRetType, ok bool) { return getSingleUserGetDefaultDatabaseAttributeTypeOk(o.DefaultDatabase) } // HasDefaultDatabase returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SingleUser) HasDefaultDatabase() bool { _, ok := o.GetDefaultDatabaseOk() return ok } // SetDefaultDatabase gets a reference to the given string and assigns it to the DefaultDatabase field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SingleUser) SetDefaultDatabase(v SingleUserGetDefaultDatabaseRetType) { setSingleUserGetDefaultDatabaseAttributeType(&o.DefaultDatabase, 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 *SingleUser) GetHost() (res SingleUserGetHostRetType) { res, _ = o.GetHostOk() return @@ -243,22 +302,26 @@ func (o *SingleUser) GetHost() (res SingleUserGetHostRetType) { // 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 *SingleUser) GetHostOk() (ret SingleUserGetHostRetType, ok bool) { return getSingleUserGetHostAttributeTypeOk(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 *SingleUser) 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 *SingleUser) SetHost(v SingleUserGetHostRetType) { setSingleUserGetHostAttributeType(&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 *SingleUser) GetId() (res SingleUserGetIdRetType) { res, _ = o.GetIdOk() return @@ -266,22 +329,26 @@ func (o *SingleUser) GetId() (res SingleUserGetIdRetType) { // 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 *SingleUser) GetIdOk() (ret SingleUserGetIdRetType, ok bool) { return getSingleUserGetIdAttributeTypeOk(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 *SingleUser) 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 *SingleUser) SetId(v SingleUserGetIdRetType) { setSingleUserGetIdAttributeType(&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 *SingleUser) GetPassword() (res SingleUserGetPasswordRetType) { res, _ = o.GetPasswordOk() return @@ -289,22 +356,26 @@ func (o *SingleUser) GetPassword() (res SingleUserGetPasswordRetType) { // 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 *SingleUser) GetPasswordOk() (ret SingleUserGetPasswordRetType, ok bool) { return getSingleUserGetPasswordAttributeTypeOk(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 *SingleUser) 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 *SingleUser) SetPassword(v SingleUserGetPasswordRetType) { setSingleUserGetPasswordAttributeType(&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 *SingleUser) GetPort() (res SingleUserGetPortRetType) { res, _ = o.GetPortOk() return @@ -312,22 +383,26 @@ func (o *SingleUser) GetPort() (res SingleUserGetPortRetType) { // 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 *SingleUser) GetPortOk() (ret SingleUserGetPortRetType, ok bool) { return getSingleUserGetPortAttributeTypeOk(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 *SingleUser) 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 *SingleUser) SetPort(v SingleUserGetPortRetType) { setSingleUserGetPortAttributeType(&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 *SingleUser) GetRoles() (res SingleUserGetRolesRetType) { res, _ = o.GetRolesOk() return @@ -335,22 +410,26 @@ func (o *SingleUser) GetRoles() (res SingleUserGetRolesRetType) { // 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 *SingleUser) GetRolesOk() (ret SingleUserGetRolesRetType, ok bool) { return getSingleUserGetRolesAttributeTypeOk(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 *SingleUser) 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 *SingleUser) SetRoles(v SingleUserGetRolesRetType) { setSingleUserGetRolesAttributeType(&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 *SingleUser) GetUri() (res SingleUserGetUriRetType) { res, _ = o.GetUriOk() return @@ -358,22 +437,26 @@ func (o *SingleUser) GetUri() (res SingleUserGetUriRetType) { // 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 *SingleUser) GetUriOk() (ret SingleUserGetUriRetType, ok bool) { return getSingleUserGetUriAttributeTypeOk(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 *SingleUser) 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 *SingleUser) SetUri(v SingleUserGetUriRetType) { setSingleUserGetUriAttributeType(&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 *SingleUser) GetUsername() (res SingleUserGetUsernameRetType) { res, _ = o.GetUsernameOk() return @@ -381,21 +464,25 @@ func (o *SingleUser) GetUsername() (res SingleUserGetUsernameRetType) { // 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 *SingleUser) GetUsernameOk() (ret SingleUserGetUsernameRetType, ok bool) { return getSingleUserGetUsernameAttributeTypeOk(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 *SingleUser) 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 *SingleUser) SetUsername(v SingleUserGetUsernameRetType) { setSingleUserGetUsernameAttributeType(&o.Username, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o SingleUser) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getSingleUserGetDefaultDatabaseAttributeTypeOk(o.DefaultDatabase); ok { @@ -425,37 +512,45 @@ func (o SingleUser) 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 NullableSingleUser struct { value *SingleUser isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableSingleUser) Get() *SingleUser { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableSingleUser) Set(val *SingleUser) { 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 NullableSingleUser) 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 *NullableSingleUser) 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 NewNullableSingleUser(val *SingleUser) *NullableSingleUser { return &NullableSingleUser{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 NullableSingleUser) 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 *NullableSingleUser) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/sqlserverflex/model_storage.go b/services/sqlserverflex/model_storage.go index 80baab97c..58118835f 100644 --- a/services/sqlserverflex/model_storage.go +++ b/services/sqlserverflex/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 sqlserverflex 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/sqlserverflex/model_storage_range.go b/services/sqlserverflex/model_storage_range.go index 175ab890d..97c28cf71 100644 --- a/services/sqlserverflex/model_storage_range.go +++ b/services/sqlserverflex/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 sqlserverflex 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/sqlserverflex/model_trigger_database_restore_payload.go b/services/sqlserverflex/model_trigger_database_restore_payload.go index b6a6bdbe2..7f69657a3 100644 --- a/services/sqlserverflex/model_trigger_database_restore_payload.go +++ b/services/sqlserverflex/model_trigger_database_restore_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 sqlserverflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &TriggerDatabaseRestorePayload{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type TriggerDatabaseRestorePayloadGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getTriggerDatabaseRestorePayloadGetNameAttributeTypeOk(arg TriggerDatabaseRestorePayloadGetNameAttributeType) (ret TriggerDatabaseRestorePayloadGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getTriggerDatabaseRestorePayloadGetNameAttributeTypeOk(arg TriggerDatabaseR return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setTriggerDatabaseRestorePayloadGetNameAttributeType(arg *TriggerDatabaseRestorePayloadGetNameAttributeType, val TriggerDatabaseRestorePayloadGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type TriggerDatabaseRestorePayloadGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type TriggerDatabaseRestorePayloadGetNameRetType = string /* @@ -43,8 +50,10 @@ type TriggerDatabaseRestorePayloadGetNameRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type TriggerDatabaseRestorePayloadGetRestoreDateTimeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getTriggerDatabaseRestorePayloadGetRestoreDateTimeAttributeTypeOk(arg TriggerDatabaseRestorePayloadGetRestoreDateTimeAttributeType) (ret TriggerDatabaseRestorePayloadGetRestoreDateTimeRetType, ok bool) { if arg == nil { return ret, false @@ -52,14 +61,19 @@ func getTriggerDatabaseRestorePayloadGetRestoreDateTimeAttributeTypeOk(arg Trigg return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setTriggerDatabaseRestorePayloadGetRestoreDateTimeAttributeType(arg *TriggerDatabaseRestorePayloadGetRestoreDateTimeAttributeType, val TriggerDatabaseRestorePayloadGetRestoreDateTimeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type TriggerDatabaseRestorePayloadGetRestoreDateTimeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type TriggerDatabaseRestorePayloadGetRestoreDateTimeRetType = string // TriggerDatabaseRestorePayload struct for TriggerDatabaseRestorePayload +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type TriggerDatabaseRestorePayload struct { // Name for the restored database no overwrite allowed at the moment // REQUIRED @@ -69,12 +83,14 @@ type TriggerDatabaseRestorePayload struct { RestoreDateTime TriggerDatabaseRestorePayloadGetRestoreDateTimeAttributeType `json:"restoreDateTime" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _TriggerDatabaseRestorePayload TriggerDatabaseRestorePayload // NewTriggerDatabaseRestorePayload instantiates a new TriggerDatabaseRestorePayload object // This constructor will assign default values to properties that have it defined, // 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 NewTriggerDatabaseRestorePayload(name TriggerDatabaseRestorePayloadGetNameArgType, restoreDateTime TriggerDatabaseRestorePayloadGetRestoreDateTimeArgType) *TriggerDatabaseRestorePayload { this := TriggerDatabaseRestorePayload{} setTriggerDatabaseRestorePayloadGetNameAttributeType(&this.Name, name) @@ -85,12 +101,14 @@ func NewTriggerDatabaseRestorePayload(name TriggerDatabaseRestorePayloadGetNameA // NewTriggerDatabaseRestorePayloadWithDefaults instantiates a new TriggerDatabaseRestorePayload object // This 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 NewTriggerDatabaseRestorePayloadWithDefaults() *TriggerDatabaseRestorePayload { this := TriggerDatabaseRestorePayload{} return &this } // 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 *TriggerDatabaseRestorePayload) GetName() (ret TriggerDatabaseRestorePayloadGetNameRetType) { ret, _ = o.GetNameOk() return ret @@ -98,16 +116,19 @@ func (o *TriggerDatabaseRestorePayload) GetName() (ret TriggerDatabaseRestorePay // 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 *TriggerDatabaseRestorePayload) GetNameOk() (ret TriggerDatabaseRestorePayloadGetNameRetType, ok bool) { return getTriggerDatabaseRestorePayloadGetNameAttributeTypeOk(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 *TriggerDatabaseRestorePayload) SetName(v TriggerDatabaseRestorePayloadGetNameRetType) { setTriggerDatabaseRestorePayloadGetNameAttributeType(&o.Name, v) } // GetRestoreDateTime returns the RestoreDateTime field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *TriggerDatabaseRestorePayload) GetRestoreDateTime() (ret TriggerDatabaseRestorePayloadGetRestoreDateTimeRetType) { ret, _ = o.GetRestoreDateTimeOk() return ret @@ -115,15 +136,18 @@ func (o *TriggerDatabaseRestorePayload) GetRestoreDateTime() (ret TriggerDatabas // GetRestoreDateTimeOk returns a tuple with the RestoreDateTime 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 *TriggerDatabaseRestorePayload) GetRestoreDateTimeOk() (ret TriggerDatabaseRestorePayloadGetRestoreDateTimeRetType, ok bool) { return getTriggerDatabaseRestorePayloadGetRestoreDateTimeAttributeTypeOk(o.RestoreDateTime) } // SetRestoreDateTime sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *TriggerDatabaseRestorePayload) SetRestoreDateTime(v TriggerDatabaseRestorePayloadGetRestoreDateTimeRetType) { setTriggerDatabaseRestorePayloadGetRestoreDateTimeAttributeType(&o.RestoreDateTime, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o TriggerDatabaseRestorePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getTriggerDatabaseRestorePayloadGetNameAttributeTypeOk(o.Name); ok { @@ -135,37 +159,45 @@ func (o TriggerDatabaseRestorePayload) 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 NullableTriggerDatabaseRestorePayload struct { value *TriggerDatabaseRestorePayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableTriggerDatabaseRestorePayload) Get() *TriggerDatabaseRestorePayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableTriggerDatabaseRestorePayload) Set(val *TriggerDatabaseRestorePayload) { 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 NullableTriggerDatabaseRestorePayload) 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 *NullableTriggerDatabaseRestorePayload) 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 NewNullableTriggerDatabaseRestorePayload(val *TriggerDatabaseRestorePayload) *NullableTriggerDatabaseRestorePayload { return &NullableTriggerDatabaseRestorePayload{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 NullableTriggerDatabaseRestorePayload) 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 *NullableTriggerDatabaseRestorePayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/sqlserverflex/model_type.go b/services/sqlserverflex/model_type.go index 955aa76f2..01755912e 100644 --- a/services/sqlserverflex/model_type.go +++ b/services/sqlserverflex/model_type.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 sqlserverflex import ( @@ -16,19 +17,27 @@ import ( ) // Type the model 'Type' +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Type string // List of Type const ( - TYPE_NOT_FOUND Type = "NotFound" - TYPE_CREATE Type = "Create" - TYPE_READ Type = "Read" - TYPE_DELETE Type = "Delete" - TYPE_UPDATE Type = "Update" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + TYPE_NOT_FOUND Type = "NotFound" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + TYPE_CREATE Type = "Create" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + TYPE_READ Type = "Read" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + TYPE_DELETE Type = "Delete" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + TYPE_UPDATE Type = "Update" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead TYPE_VALIDATION Type = "Validation" ) // All allowed values of Type enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead var AllowedTypeEnumValues = []Type{ "NotFound", "Create", @@ -38,6 +47,7 @@ var AllowedTypeEnumValues = []Type{ "Validation", } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *Type) UnmarshalJSON(src []byte) error { var value string err := json.Unmarshal(src, &value) @@ -62,6 +72,7 @@ func (v *Type) UnmarshalJSON(src []byte) error { // NewTypeFromValue returns a pointer to a valid Type // for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewTypeFromValue(v string) (*Type, error) { ev := Type(v) if ev.IsValid() { @@ -72,6 +83,7 @@ func NewTypeFromValue(v string) (*Type, error) { } // IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v Type) IsValid() bool { for _, existing := range AllowedTypeEnumValues { if existing == v { @@ -82,41 +94,50 @@ func (v Type) IsValid() bool { } // Ptr returns reference to Type value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v Type) Ptr() *Type { return &v } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableType struct { value *Type isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableType) Get() *Type { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableType) Set(val *Type) { 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 NullableType) 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 *NullableType) 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 NewNullableType(val *Type) *NullableType { return &NullableType{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 NullableType) 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 *NullableType) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/sqlserverflex/model_update_instance_payload.go b/services/sqlserverflex/model_update_instance_payload.go index 6c1e664e5..465581f48 100644 --- a/services/sqlserverflex/model_update_instance_payload.go +++ b/services/sqlserverflex/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 sqlserverflex 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 = *CreateInstancePayloadAcl + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateInstancePayloadGetAclArgType = CreateInstancePayloadAcl + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateInstancePayloadGetAclRetType = CreateInstancePayloadAcl +// 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 */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateInstancePayloadGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateInstancePayloadGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateInstancePayloadGetLabelsRetType = map[string]interface{} +// 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,8 +158,10 @@ type UpdateInstancePayloadGetNameRetType = string */ // 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 @@ -134,14 +169,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 { // REQUIRED Acl UpdateInstancePayloadGetAclAttributeType `json:"acl" required:"true"` @@ -161,12 +201,14 @@ type UpdateInstancePayload struct { Version UpdateInstancePayloadGetVersionAttributeType `json:"version" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _UpdateInstancePayload UpdateInstancePayload // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdateInstancePayload(acl UpdateInstancePayloadGetAclArgType, backupSchedule UpdateInstancePayloadGetBackupScheduleArgType, flavorId UpdateInstancePayloadGetFlavorIdArgType, labels UpdateInstancePayloadGetLabelsArgType, name UpdateInstancePayloadGetNameArgType, version UpdateInstancePayloadGetVersionArgType) *UpdateInstancePayload { this := UpdateInstancePayload{} setUpdateInstancePayloadGetAclAttributeType(&this.Acl, acl) @@ -181,6 +223,7 @@ func NewUpdateInstancePayload(acl UpdateInstancePayloadGetAclArgType, backupSche // 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{} var version string = "2022" @@ -189,6 +232,7 @@ func NewUpdateInstancePayloadWithDefaults() *UpdateInstancePayload { } // 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 *UpdateInstancePayload) GetAcl() (ret UpdateInstancePayloadGetAclRetType) { ret, _ = o.GetAclOk() return ret @@ -196,16 +240,19 @@ func (o *UpdateInstancePayload) GetAcl() (ret UpdateInstancePayloadGetAclRetType // 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 *UpdateInstancePayload) GetAclOk() (ret UpdateInstancePayloadGetAclRetType, ok bool) { return getUpdateInstancePayloadGetAclAttributeTypeOk(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 *UpdateInstancePayload) SetAcl(v UpdateInstancePayloadGetAclRetType) { setUpdateInstancePayloadGetAclAttributeType(&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 *UpdateInstancePayload) GetBackupSchedule() (ret UpdateInstancePayloadGetBackupScheduleRetType) { ret, _ = o.GetBackupScheduleOk() return ret @@ -213,16 +260,19 @@ func (o *UpdateInstancePayload) GetBackupSchedule() (ret UpdateInstancePayloadGe // 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 *UpdateInstancePayload) GetBackupScheduleOk() (ret UpdateInstancePayloadGetBackupScheduleRetType, ok bool) { return getUpdateInstancePayloadGetBackupScheduleAttributeTypeOk(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 *UpdateInstancePayload) SetBackupSchedule(v UpdateInstancePayloadGetBackupScheduleRetType) { setUpdateInstancePayloadGetBackupScheduleAttributeType(&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 *UpdateInstancePayload) GetFlavorId() (ret UpdateInstancePayloadGetFlavorIdRetType) { ret, _ = o.GetFlavorIdOk() return ret @@ -230,16 +280,19 @@ func (o *UpdateInstancePayload) GetFlavorId() (ret UpdateInstancePayloadGetFlavo // 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 *UpdateInstancePayload) GetFlavorIdOk() (ret UpdateInstancePayloadGetFlavorIdRetType, ok bool) { return getUpdateInstancePayloadGetFlavorIdAttributeTypeOk(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 *UpdateInstancePayload) SetFlavorId(v UpdateInstancePayloadGetFlavorIdRetType) { setUpdateInstancePayloadGetFlavorIdAttributeType(&o.FlavorId, v) } // GetLabels returns the Labels field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) GetLabels() (ret UpdateInstancePayloadGetLabelsRetType) { ret, _ = o.GetLabelsOk() return ret @@ -247,16 +300,19 @@ func (o *UpdateInstancePayload) GetLabels() (ret UpdateInstancePayloadGetLabelsR // GetLabelsOk returns a tuple with the Labels 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 *UpdateInstancePayload) GetLabelsOk() (ret UpdateInstancePayloadGetLabelsRetType, ok bool) { return getUpdateInstancePayloadGetLabelsAttributeTypeOk(o.Labels) } // SetLabels sets field value +// 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) GetName() (ret UpdateInstancePayloadGetNameRetType) { ret, _ = o.GetNameOk() return ret @@ -264,16 +320,19 @@ func (o *UpdateInstancePayload) GetName() (ret UpdateInstancePayloadGetNameRetTy // 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 *UpdateInstancePayload) GetNameOk() (ret UpdateInstancePayloadGetNameRetType, ok bool) { return getUpdateInstancePayloadGetNameAttributeTypeOk(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 *UpdateInstancePayload) SetName(v UpdateInstancePayloadGetNameRetType) { setUpdateInstancePayloadGetNameAttributeType(&o.Name, 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 *UpdateInstancePayload) GetVersion() (ret UpdateInstancePayloadGetVersionRetType) { ret, _ = o.GetVersionOk() return ret @@ -281,15 +340,18 @@ func (o *UpdateInstancePayload) GetVersion() (ret UpdateInstancePayloadGetVersio // 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 *UpdateInstancePayload) GetVersionOk() (ret UpdateInstancePayloadGetVersionRetType, ok bool) { return getUpdateInstancePayloadGetVersionAttributeTypeOk(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 *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 { @@ -313,37 +375,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/sqlserverflex/model_update_instance_response.go b/services/sqlserverflex/model_update_instance_response.go index 144342524..27df89184 100644 --- a/services/sqlserverflex/model_update_instance_response.go +++ b/services/sqlserverflex/model_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 sqlserverflex import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &UpdateInstanceResponse{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateInstanceResponseGetItemAttributeType = *Instance + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateInstanceResponseGetItemArgType = Instance + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateInstanceResponseGetItemRetType = Instance +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateInstanceResponseGetItemAttributeTypeOk(arg UpdateInstanceResponseGetItemAttributeType) (ret UpdateInstanceResponseGetItemRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getUpdateInstanceResponseGetItemAttributeTypeOk(arg UpdateInstanceResponseG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateInstanceResponseGetItemAttributeType(arg *UpdateInstanceResponseGetItemAttributeType, val UpdateInstanceResponseGetItemRetType) { *arg = &val } // UpdateInstanceResponse struct for UpdateInstanceResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateInstanceResponse struct { Item UpdateInstanceResponseGetItemAttributeType `json:"item,omitempty"` } @@ -46,6 +55,7 @@ type UpdateInstanceResponse 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 NewUpdateInstanceResponse() *UpdateInstanceResponse { this := UpdateInstanceResponse{} return &this @@ -54,12 +64,14 @@ func NewUpdateInstanceResponse() *UpdateInstanceResponse { // NewUpdateInstanceResponseWithDefaults instantiates a new UpdateInstanceResponse object // This 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 NewUpdateInstanceResponseWithDefaults() *UpdateInstanceResponse { this := UpdateInstanceResponse{} 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 *UpdateInstanceResponse) GetItem() (res UpdateInstanceResponseGetItemRetType) { res, _ = o.GetItemOk() return @@ -67,21 +79,25 @@ func (o *UpdateInstanceResponse) GetItem() (res UpdateInstanceResponseGetItemRet // 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 *UpdateInstanceResponse) GetItemOk() (ret UpdateInstanceResponseGetItemRetType, ok bool) { return getUpdateInstanceResponseGetItemAttributeTypeOk(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 *UpdateInstanceResponse) 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 *UpdateInstanceResponse) SetItem(v UpdateInstanceResponseGetItemRetType) { setUpdateInstanceResponseGetItemAttributeType(&o.Item, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o UpdateInstanceResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getUpdateInstanceResponseGetItemAttributeTypeOk(o.Item); ok { @@ -90,37 +106,45 @@ func (o UpdateInstanceResponse) 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 NullableUpdateInstanceResponse struct { value *UpdateInstanceResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateInstanceResponse) Get() *UpdateInstanceResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateInstanceResponse) Set(val *UpdateInstanceResponse) { 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 NullableUpdateInstanceResponse) 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 *NullableUpdateInstanceResponse) 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 NewNullableUpdateInstanceResponse(val *UpdateInstanceResponse) *NullableUpdateInstanceResponse { return &NullableUpdateInstanceResponse{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 NullableUpdateInstanceResponse) 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 *NullableUpdateInstanceResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/sqlserverflex/model_user.go b/services/sqlserverflex/model_user.go index cb02f0161..fca220687 100644 --- a/services/sqlserverflex/model_user.go +++ b/services/sqlserverflex/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 sqlserverflex 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/sqlserverflex/model_user_response_user.go b/services/sqlserverflex/model_user_response_user.go index c7b095952..4a630cc9d 100644 --- a/services/sqlserverflex/model_user_response_user.go +++ b/services/sqlserverflex/model_user_response_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 sqlserverflex import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &UserResponseUser{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserResponseUserGetDefaultDatabaseAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUserResponseUserGetDefaultDatabaseAttributeTypeOk(arg UserResponseUserGetDefaultDatabaseAttributeType) (ret UserResponseUserGetDefaultDatabaseRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getUserResponseUserGetDefaultDatabaseAttributeTypeOk(arg UserResponseUserGe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUserResponseUserGetDefaultDatabaseAttributeType(arg *UserResponseUserGetDefaultDatabaseAttributeType, val UserResponseUserGetDefaultDatabaseRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserResponseUserGetDefaultDatabaseArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserResponseUserGetDefaultDatabaseRetType = string /* @@ -43,8 +50,10 @@ type UserResponseUserGetDefaultDatabaseRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserResponseUserGetHostAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUserResponseUserGetHostAttributeTypeOk(arg UserResponseUserGetHostAttributeType) (ret UserResponseUserGetHostRetType, ok bool) { if arg == nil { return ret, false @@ -52,11 +61,15 @@ func getUserResponseUserGetHostAttributeTypeOk(arg UserResponseUserGetHostAttrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUserResponseUserGetHostAttributeType(arg *UserResponseUserGetHostAttributeType, val UserResponseUserGetHostRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserResponseUserGetHostArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserResponseUserGetHostRetType = string /* @@ -64,8 +77,10 @@ type UserResponseUserGetHostRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserResponseUserGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUserResponseUserGetIdAttributeTypeOk(arg UserResponseUserGetIdAttributeType) (ret UserResponseUserGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -73,11 +88,15 @@ func getUserResponseUserGetIdAttributeTypeOk(arg UserResponseUserGetIdAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUserResponseUserGetIdAttributeType(arg *UserResponseUserGetIdAttributeType, val UserResponseUserGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserResponseUserGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserResponseUserGetIdRetType = string /* @@ -85,10 +104,16 @@ type UserResponseUserGetIdRetType = string */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserResponseUserGetPortAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserResponseUserGetPortArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserResponseUserGetPortRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUserResponseUserGetPortAttributeTypeOk(arg UserResponseUserGetPortAttributeType) (ret UserResponseUserGetPortRetType, ok bool) { if arg == nil { return ret, false @@ -96,6 +121,7 @@ func getUserResponseUserGetPortAttributeTypeOk(arg UserResponseUserGetPortAttrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUserResponseUserGetPortAttributeType(arg *UserResponseUserGetPortAttributeType, val UserResponseUserGetPortRetType) { *arg = &val } @@ -105,10 +131,16 @@ func setUserResponseUserGetPortAttributeType(arg *UserResponseUserGetPortAttribu */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserResponseUserGetRolesAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserResponseUserGetRolesArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserResponseUserGetRolesRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUserResponseUserGetRolesAttributeTypeOk(arg UserResponseUserGetRolesAttributeType) (ret UserResponseUserGetRolesRetType, ok bool) { if arg == nil { return ret, false @@ -116,6 +148,7 @@ func getUserResponseUserGetRolesAttributeTypeOk(arg UserResponseUserGetRolesAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUserResponseUserGetRolesAttributeType(arg *UserResponseUserGetRolesAttributeType, val UserResponseUserGetRolesRetType) { *arg = &val } @@ -125,8 +158,10 @@ func setUserResponseUserGetRolesAttributeType(arg *UserResponseUserGetRolesAttri */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserResponseUserGetUsernameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUserResponseUserGetUsernameAttributeTypeOk(arg UserResponseUserGetUsernameAttributeType) (ret UserResponseUserGetUsernameRetType, ok bool) { if arg == nil { return ret, false @@ -134,14 +169,19 @@ func getUserResponseUserGetUsernameAttributeTypeOk(arg UserResponseUserGetUserna return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUserResponseUserGetUsernameAttributeType(arg *UserResponseUserGetUsernameAttributeType, val UserResponseUserGetUsernameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserResponseUserGetUsernameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserResponseUserGetUsernameRetType = string // UserResponseUser struct for UserResponseUser +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UserResponseUser struct { DefaultDatabase UserResponseUserGetDefaultDatabaseAttributeType `json:"default_database,omitempty"` Host UserResponseUserGetHostAttributeType `json:"host,omitempty"` @@ -155,6 +195,7 @@ type UserResponseUser 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 NewUserResponseUser() *UserResponseUser { this := UserResponseUser{} return &this @@ -163,12 +204,14 @@ func NewUserResponseUser() *UserResponseUser { // NewUserResponseUserWithDefaults instantiates a new UserResponseUser object // This 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 NewUserResponseUserWithDefaults() *UserResponseUser { this := UserResponseUser{} return &this } // GetDefaultDatabase returns the DefaultDatabase field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UserResponseUser) GetDefaultDatabase() (res UserResponseUserGetDefaultDatabaseRetType) { res, _ = o.GetDefaultDatabaseOk() return @@ -176,22 +219,26 @@ func (o *UserResponseUser) GetDefaultDatabase() (res UserResponseUserGetDefaultD // GetDefaultDatabaseOk returns a tuple with the DefaultDatabase field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UserResponseUser) GetDefaultDatabaseOk() (ret UserResponseUserGetDefaultDatabaseRetType, ok bool) { return getUserResponseUserGetDefaultDatabaseAttributeTypeOk(o.DefaultDatabase) } // HasDefaultDatabase returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UserResponseUser) HasDefaultDatabase() bool { _, ok := o.GetDefaultDatabaseOk() return ok } // SetDefaultDatabase gets a reference to the given string and assigns it to the DefaultDatabase field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UserResponseUser) SetDefaultDatabase(v UserResponseUserGetDefaultDatabaseRetType) { setUserResponseUserGetDefaultDatabaseAttributeType(&o.DefaultDatabase, 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 *UserResponseUser) GetHost() (res UserResponseUserGetHostRetType) { res, _ = o.GetHostOk() return @@ -199,22 +246,26 @@ func (o *UserResponseUser) GetHost() (res UserResponseUserGetHostRetType) { // 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 *UserResponseUser) GetHostOk() (ret UserResponseUserGetHostRetType, ok bool) { return getUserResponseUserGetHostAttributeTypeOk(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 *UserResponseUser) 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 *UserResponseUser) SetHost(v UserResponseUserGetHostRetType) { setUserResponseUserGetHostAttributeType(&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 *UserResponseUser) GetId() (res UserResponseUserGetIdRetType) { res, _ = o.GetIdOk() return @@ -222,22 +273,26 @@ func (o *UserResponseUser) GetId() (res UserResponseUserGetIdRetType) { // 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 *UserResponseUser) GetIdOk() (ret UserResponseUserGetIdRetType, ok bool) { return getUserResponseUserGetIdAttributeTypeOk(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 *UserResponseUser) 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 *UserResponseUser) SetId(v UserResponseUserGetIdRetType) { setUserResponseUserGetIdAttributeType(&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 *UserResponseUser) GetPort() (res UserResponseUserGetPortRetType) { res, _ = o.GetPortOk() return @@ -245,22 +300,26 @@ func (o *UserResponseUser) GetPort() (res UserResponseUserGetPortRetType) { // 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 *UserResponseUser) GetPortOk() (ret UserResponseUserGetPortRetType, ok bool) { return getUserResponseUserGetPortAttributeTypeOk(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 *UserResponseUser) 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 *UserResponseUser) SetPort(v UserResponseUserGetPortRetType) { setUserResponseUserGetPortAttributeType(&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 *UserResponseUser) GetRoles() (res UserResponseUserGetRolesRetType) { res, _ = o.GetRolesOk() return @@ -268,22 +327,26 @@ func (o *UserResponseUser) GetRoles() (res UserResponseUserGetRolesRetType) { // 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 *UserResponseUser) GetRolesOk() (ret UserResponseUserGetRolesRetType, ok bool) { return getUserResponseUserGetRolesAttributeTypeOk(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 *UserResponseUser) 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 *UserResponseUser) SetRoles(v UserResponseUserGetRolesRetType) { setUserResponseUserGetRolesAttributeType(&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 *UserResponseUser) GetUsername() (res UserResponseUserGetUsernameRetType) { res, _ = o.GetUsernameOk() return @@ -291,21 +354,25 @@ func (o *UserResponseUser) GetUsername() (res UserResponseUserGetUsernameRetType // 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 *UserResponseUser) GetUsernameOk() (ret UserResponseUserGetUsernameRetType, ok bool) { return getUserResponseUserGetUsernameAttributeTypeOk(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 *UserResponseUser) 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 *UserResponseUser) SetUsername(v UserResponseUserGetUsernameRetType) { setUserResponseUserGetUsernameAttributeType(&o.Username, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o UserResponseUser) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getUserResponseUserGetDefaultDatabaseAttributeTypeOk(o.DefaultDatabase); ok { @@ -329,37 +396,45 @@ func (o UserResponseUser) 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 NullableUserResponseUser struct { value *UserResponseUser isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUserResponseUser) Get() *UserResponseUser { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUserResponseUser) Set(val *UserResponseUser) { 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 NullableUserResponseUser) 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 *NullableUserResponseUser) 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 NewNullableUserResponseUser(val *UserResponseUser) *NullableUserResponseUser { return &NullableUserResponseUser{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 NullableUserResponseUser) 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 *NullableUserResponseUser) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/sqlserverflex/oas_commit b/services/sqlserverflex/oas_commit index 588ee296b..853627d06 100644 --- a/services/sqlserverflex/oas_commit +++ b/services/sqlserverflex/oas_commit @@ -1 +1 @@ -964ac4ce34f0b6417f2496a1d48585c4926dee3a +335aa32af4d6c0d2a036b8567773da2f051f7efb diff --git a/services/sqlserverflex/utils.go b/services/sqlserverflex/utils.go index 83e0ca3f9..96520b326 100644 --- a/services/sqlserverflex/utils.go +++ b/services/sqlserverflex/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/sqlserverflex/v1api/api_default.go b/services/sqlserverflex/v1api/api_default.go new file mode 100644 index 000000000..d40fab0c5 --- /dev/null +++ b/services/sqlserverflex/v1api/api_default.go @@ -0,0 +1,4247 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 { + + /* + CreateDatabase Create a Database + + Create a 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 + @return ApiCreateDatabaseRequest + */ + CreateDatabase(ctx context.Context, projectId string, instanceId string) ApiCreateDatabaseRequest + + // CreateDatabaseExecute executes the request + // @return CreateDatabaseResponse + CreateDatabaseExecute(r ApiCreateDatabaseRequest) (*CreateDatabaseResponse, *http.Response, error) + + /* + CreateInstance Create Instance + + Create a new instance of a sqlServerCRD 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, *http.Response, 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, *http.Response, 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 databaseName Database Name + @return ApiDeleteDatabaseRequest + */ + DeleteDatabase(ctx context.Context, projectId string, instanceId string, databaseName string) ApiDeleteDatabaseRequest + + // DeleteDatabaseExecute executes the request + DeleteDatabaseExecute(r ApiDeleteDatabaseRequest) (*http.Response, 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) (*http.Response, 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) (*http.Response, 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, *http.Response, error) + + /* + GetDatabase Get specific Database + + Get specific available database + + @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 databaseName Database Name + @return ApiGetDatabaseRequest + */ + GetDatabase(ctx context.Context, projectId string, instanceId string, databaseName string) ApiGetDatabaseRequest + + // GetDatabaseExecute executes the request + // @return GetDatabaseResponse + GetDatabaseExecute(r ApiGetDatabaseRequest) (*GetDatabaseResponse, *http.Response, 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 GetInstanceResponse + GetInstanceExecute(r ApiGetInstanceRequest) (*GetInstanceResponse, *http.Response, 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, *http.Response, 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, *http.Response, error) + + /* + ListCollations Get database collation list + + Returns a list of collations + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The ID of the STACKIT project + @param instanceId The ID of the instance + @return ApiListCollationsRequest + */ + ListCollations(ctx context.Context, projectId string, instanceId string) ApiListCollationsRequest + + // ListCollationsExecute executes the request + // @return ListCollationsResponse + ListCollationsExecute(r ApiListCollationsRequest) (*ListCollationsResponse, *http.Response, error) + + /* + ListCompatibility Get database compatibility list + + Returns a list of compatibility levels for creating a new database + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The ID of the STACKIT project + @param instanceId The ID of the instance + @return ApiListCompatibilityRequest + */ + ListCompatibility(ctx context.Context, projectId string, instanceId string) ApiListCompatibilityRequest + + // ListCompatibilityExecute executes the request + // @return ListCompatibilityResponse + ListCompatibilityExecute(r ApiListCompatibilityRequest) (*ListCompatibilityResponse, *http.Response, error) + + /* + ListDatabases Get list of databases + + Get list of all databases in the 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 ListDatabasesResponse + ListDatabasesExecute(r ApiListDatabasesRequest) (*ListDatabasesResponse, *http.Response, 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, *http.Response, 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, *http.Response, 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 instanceId The UUID of the instance. + @param metric The name of the metric. Valid metrics are 'cpu', 'memory', 'data-disk-size', 'data-disk-use','log-disk-size', 'log-disk-use', 'life-expectancy' and 'connections'. + @return ApiListMetricsRequest + */ + ListMetrics(ctx context.Context, projectId string, instanceId string, metric string) ApiListMetricsRequest + + // ListMetricsExecute executes the request + // @return ListMetricsResponse + ListMetricsExecute(r ApiListMetricsRequest) (*ListMetricsResponse, *http.Response, error) + + /* + ListRestoreJobs List current running restore jobs + + List all currently running restore jobs 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 ApiListRestoreJobsRequest + */ + ListRestoreJobs(ctx context.Context, projectId string, instanceId string) ApiListRestoreJobsRequest + + // ListRestoreJobsExecute executes the request + // @return ListRestoreJobsResponse + ListRestoreJobsExecute(r ApiListRestoreJobsRequest) (*ListRestoreJobsResponse, *http.Response, error) + + /* + ListRoles List Roles + + List available roles for an instance that can be assigned to a user + + @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 ApiListRolesRequest + */ + ListRoles(ctx context.Context, projectId string, instanceId string) ApiListRolesRequest + + // ListRolesExecute executes the request + // @return ListRolesResponse + ListRolesExecute(r ApiListRolesRequest) (*ListRolesResponse, *http.Response, 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, *http.Response, 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, *http.Response, error) + + /* + ListVersions Get Versions + + Get available versions for mssql 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, *http.Response, error) + + /* + PartialUpdateInstance Update Instance + + Update available instance of a mssql database. + + **Please note that any changes applied via PUT or PATCH requests will initiate a reboot of the SQL Server Flex 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 ApiPartialUpdateInstanceRequest + */ + PartialUpdateInstance(ctx context.Context, projectId string, instanceId string) ApiPartialUpdateInstanceRequest + + // PartialUpdateInstanceExecute executes the request + // @return UpdateInstanceResponse + PartialUpdateInstanceExecute(r ApiPartialUpdateInstanceRequest) (*UpdateInstanceResponse, *http.Response, error) + + /* + ResetUser Reset User + + Reset user password for a mssql 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, *http.Response, error) + + /* + TriggerDatabaseBackup Trigger backup for a specific Database + + Trigger backup for a specific Database + + @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 databaseName Database Name + @return ApiTriggerDatabaseBackupRequest + */ + TriggerDatabaseBackup(ctx context.Context, projectId string, instanceId string, databaseName string) ApiTriggerDatabaseBackupRequest + + // TriggerDatabaseBackupExecute executes the request + TriggerDatabaseBackupExecute(r ApiTriggerDatabaseBackupRequest) (*http.Response, error) + + /* + TriggerDatabaseRestore Trigger restore for a specific Database + + Trigger restore for a specific Database + + @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 databaseName Database Name + @return ApiTriggerDatabaseRestoreRequest + */ + TriggerDatabaseRestore(ctx context.Context, projectId string, instanceId string, databaseName string) ApiTriggerDatabaseRestoreRequest + + // TriggerDatabaseRestoreExecute executes the request + TriggerDatabaseRestoreExecute(r ApiTriggerDatabaseRestoreRequest) (*http.Response, error) + + /* + UpdateInstance Update Instance + + Update available instance of a mssql database. + + **Please note that any changes applied via PUT or PATCH requests will initiate a reboot of the SQL Server Flex 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 ApiUpdateInstanceRequest + */ + UpdateInstance(ctx context.Context, projectId string, instanceId string) ApiUpdateInstanceRequest + + // UpdateInstanceExecute executes the request + // @return UpdateInstanceResponse + UpdateInstanceExecute(r ApiUpdateInstanceRequest) (*UpdateInstanceResponse, *http.Response, error) +} + +// DefaultAPIService DefaultAPI service +type DefaultAPIService service + +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() (*CreateDatabaseResponse, *http.Response, error) { + return r.ApiService.CreateDatabaseExecute(r) +} + +/* +CreateDatabase Create a Database + +Create a 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 + @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 CreateDatabaseResponse +func (a *DefaultAPIService) CreateDatabaseExecute(r ApiCreateDatabaseRequest) (*CreateDatabaseResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateDatabaseResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateDatabase") + if err != nil { + return localVarReturnValue, nil, &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, nil, 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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, 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, *http.Response, error) { + return r.ApiService.CreateInstanceExecute(r) +} + +/* +CreateInstance Create Instance + +Create a new instance of a sqlServerCRD 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, *http.Response, 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, nil, &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, nil, 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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCreateUserRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + createUserPayload *CreateUserPayload +} + +// The request body contains a username, a list of roles and database. The possible roles can be fetched from the ListRoles endpoint. +func (r ApiCreateUserRequest) CreateUserPayload(createUserPayload CreateUserPayload) ApiCreateUserRequest { + r.createUserPayload = &createUserPayload + return r +} + +func (r ApiCreateUserRequest) Execute() (*CreateUserResponse, *http.Response, 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, *http.Response, 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, nil, &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, nil, 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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeleteDatabaseRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + databaseName string +} + +func (r ApiDeleteDatabaseRequest) Execute() (*http.Response, 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 databaseName Database Name + @return ApiDeleteDatabaseRequest +*/ +func (a *DefaultAPIService) DeleteDatabase(ctx context.Context, projectId string, instanceId string, databaseName string) ApiDeleteDatabaseRequest { + return ApiDeleteDatabaseRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + databaseName: databaseName, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteDatabaseExecute(r ApiDeleteDatabaseRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteDatabase") + if err != nil { + return nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/databases/{databaseName}" + 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, "{"+"databaseName"+"}", url.PathEscape(parameterValueToString(r.databaseName, "databaseName")), -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 nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDeleteInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string +} + +func (r ApiDeleteInstanceRequest) Execute() (*http.Response, 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) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteInstance") + if err != nil { + return nil, &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 nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDeleteUserRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + userId string +} + +func (r ApiDeleteUserRequest) Execute() (*http.Response, 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) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteUser") + if err != nil { + return nil, &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 nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiGetBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + backupId string +} + +func (r ApiGetBackupRequest) Execute() (*GetBackupResponse, *http.Response, 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, *http.Response, 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, nil, &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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetDatabaseRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + databaseName string +} + +func (r ApiGetDatabaseRequest) Execute() (*GetDatabaseResponse, *http.Response, error) { + return r.ApiService.GetDatabaseExecute(r) +} + +/* +GetDatabase Get specific Database + +Get specific available database + + @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 databaseName Database Name + @return ApiGetDatabaseRequest +*/ +func (a *DefaultAPIService) GetDatabase(ctx context.Context, projectId string, instanceId string, databaseName string) ApiGetDatabaseRequest { + return ApiGetDatabaseRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + databaseName: databaseName, + } +} + +// Execute executes the request +// +// @return GetDatabaseResponse +func (a *DefaultAPIService) GetDatabaseExecute(r ApiGetDatabaseRequest) (*GetDatabaseResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetDatabaseResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetDatabase") + if err != nil { + return localVarReturnValue, nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/databases/{databaseName}" + 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, "{"+"databaseName"+"}", url.PathEscape(parameterValueToString(r.databaseName, "databaseName")), -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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string +} + +func (r ApiGetInstanceRequest) Execute() (*GetInstanceResponse, *http.Response, 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 GetInstanceResponse +func (a *DefaultAPIService) GetInstanceExecute(r ApiGetInstanceRequest) (*GetInstanceResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetInstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetInstance") + if err != nil { + return localVarReturnValue, nil, &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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetUserRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + userId string +} + +func (r ApiGetUserRequest) Execute() (*GetUserResponse, *http.Response, 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, *http.Response, 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, nil, &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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListBackupsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string +} + +func (r ApiListBackupsRequest) Execute() (*ListBackupsResponse, *http.Response, 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, *http.Response, 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, nil, &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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListCollationsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string +} + +func (r ApiListCollationsRequest) Execute() (*ListCollationsResponse, *http.Response, error) { + return r.ApiService.ListCollationsExecute(r) +} + +/* +ListCollations Get database collation list + +Returns a list of collations + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The ID of the STACKIT project + @param instanceId The ID of the instance + @return ApiListCollationsRequest +*/ +func (a *DefaultAPIService) ListCollations(ctx context.Context, projectId string, instanceId string) ApiListCollationsRequest { + return ApiListCollationsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListCollationsResponse +func (a *DefaultAPIService) ListCollationsExecute(r ApiListCollationsRequest) (*ListCollationsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListCollationsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListCollations") + if err != nil { + return localVarReturnValue, nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/collation" + 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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListCompatibilityRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string +} + +func (r ApiListCompatibilityRequest) Execute() (*ListCompatibilityResponse, *http.Response, error) { + return r.ApiService.ListCompatibilityExecute(r) +} + +/* +ListCompatibility Get database compatibility list + +Returns a list of compatibility levels for creating a new database + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The ID of the STACKIT project + @param instanceId The ID of the instance + @return ApiListCompatibilityRequest +*/ +func (a *DefaultAPIService) ListCompatibility(ctx context.Context, projectId string, instanceId string) ApiListCompatibilityRequest { + return ApiListCompatibilityRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListCompatibilityResponse +func (a *DefaultAPIService) ListCompatibilityExecute(r ApiListCompatibilityRequest) (*ListCompatibilityResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListCompatibilityResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListCompatibility") + if err != nil { + return localVarReturnValue, nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/compatibility" + 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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListDatabasesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string +} + +func (r ApiListDatabasesRequest) Execute() (*ListDatabasesResponse, *http.Response, error) { + return r.ApiService.ListDatabasesExecute(r) +} + +/* +ListDatabases Get list of databases + +Get list of all databases in the 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 ListDatabasesResponse +func (a *DefaultAPIService) ListDatabasesExecute(r ApiListDatabasesRequest) (*ListDatabasesResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListDatabasesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListDatabases") + if err != nil { + return localVarReturnValue, nil, &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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListFlavorsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string +} + +func (r ApiListFlavorsRequest) Execute() (*ListFlavorsResponse, *http.Response, 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, *http.Response, 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, nil, &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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListInstancesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string +} + +func (r ApiListInstancesRequest) Execute() (*ListInstancesResponse, *http.Response, 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, *http.Response, 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, nil, &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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, 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() (*ListMetricsResponse, *http.Response, 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 instanceId The UUID of the instance. + @param metric The name of the metric. Valid metrics are 'cpu', 'memory', 'data-disk-size', 'data-disk-use','log-disk-size', 'log-disk-use', 'life-expectancy' 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 ListMetricsResponse +func (a *DefaultAPIService) ListMetricsExecute(r ApiListMetricsRequest) (*ListMetricsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListMetricsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListMetrics") + if err != nil { + return localVarReturnValue, nil, &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, nil, 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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListRestoreJobsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string +} + +func (r ApiListRestoreJobsRequest) Execute() (*ListRestoreJobsResponse, *http.Response, error) { + return r.ApiService.ListRestoreJobsExecute(r) +} + +/* +ListRestoreJobs List current running restore jobs + +List all currently running restore jobs 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 ApiListRestoreJobsRequest +*/ +func (a *DefaultAPIService) ListRestoreJobs(ctx context.Context, projectId string, instanceId string) ApiListRestoreJobsRequest { + return ApiListRestoreJobsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListRestoreJobsResponse +func (a *DefaultAPIService) ListRestoreJobsExecute(r ApiListRestoreJobsRequest) (*ListRestoreJobsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListRestoreJobsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListRestoreJobs") + if err != nil { + return localVarReturnValue, nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/restores" + 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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListRolesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string +} + +func (r ApiListRolesRequest) Execute() (*ListRolesResponse, *http.Response, error) { + return r.ApiService.ListRolesExecute(r) +} + +/* +ListRoles List Roles + +List available roles for an instance that can be assigned to a user + + @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 ApiListRolesRequest +*/ +func (a *DefaultAPIService) ListRoles(ctx context.Context, projectId string, instanceId string) ApiListRolesRequest { + return ApiListRolesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListRolesResponse +func (a *DefaultAPIService) ListRolesExecute(r ApiListRolesRequest) (*ListRolesResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListRolesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListRoles") + if err != nil { + return localVarReturnValue, nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/roles" + 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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListStoragesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + flavorId string +} + +func (r ApiListStoragesRequest) Execute() (*ListStoragesResponse, *http.Response, 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, *http.Response, 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, nil, &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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListUsersRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string +} + +func (r ApiListUsersRequest) Execute() (*ListUsersResponse, *http.Response, 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, *http.Response, 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, nil, &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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, 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, *http.Response, error) { + return r.ApiService.ListVersionsExecute(r) +} + +/* +ListVersions Get Versions + +Get available versions for mssql 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, *http.Response, 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, nil, &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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, 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() (*UpdateInstanceResponse, *http.Response, error) { + return r.ApiService.PartialUpdateInstanceExecute(r) +} + +/* +PartialUpdateInstance Update Instance + +Update available instance of a mssql database. + +**Please note that any changes applied via PUT or PATCH requests will initiate a reboot of the SQL Server Flex 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 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 UpdateInstanceResponse +func (a *DefaultAPIService) PartialUpdateInstanceExecute(r ApiPartialUpdateInstanceRequest) (*UpdateInstanceResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UpdateInstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PartialUpdateInstance") + if err != nil { + return localVarReturnValue, nil, &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, nil, 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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiResetUserRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + userId string +} + +func (r ApiResetUserRequest) Execute() (*ResetUserResponse, *http.Response, error) { + return r.ApiService.ResetUserExecute(r) +} + +/* +ResetUser Reset User + +Reset user password for a mssql 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, *http.Response, 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, nil, &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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTriggerDatabaseBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + databaseName string +} + +func (r ApiTriggerDatabaseBackupRequest) Execute() (*http.Response, error) { + return r.ApiService.TriggerDatabaseBackupExecute(r) +} + +/* +TriggerDatabaseBackup Trigger backup for a specific Database + +Trigger backup for a specific Database + + @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 databaseName Database Name + @return ApiTriggerDatabaseBackupRequest +*/ +func (a *DefaultAPIService) TriggerDatabaseBackup(ctx context.Context, projectId string, instanceId string, databaseName string) ApiTriggerDatabaseBackupRequest { + return ApiTriggerDatabaseBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + databaseName: databaseName, + } +} + +// Execute executes the request +func (a *DefaultAPIService) TriggerDatabaseBackupExecute(r ApiTriggerDatabaseBackupRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.TriggerDatabaseBackup") + if err != nil { + return nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups/databases/{databaseName}" + 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, "{"+"databaseName"+"}", url.PathEscape(parameterValueToString(r.databaseName, "databaseName")), -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{"*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiTriggerDatabaseRestoreRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + databaseName string + triggerDatabaseRestorePayload *TriggerDatabaseRestorePayload +} + +// Body +func (r ApiTriggerDatabaseRestoreRequest) TriggerDatabaseRestorePayload(triggerDatabaseRestorePayload TriggerDatabaseRestorePayload) ApiTriggerDatabaseRestoreRequest { + r.triggerDatabaseRestorePayload = &triggerDatabaseRestorePayload + return r +} + +func (r ApiTriggerDatabaseRestoreRequest) Execute() (*http.Response, error) { + return r.ApiService.TriggerDatabaseRestoreExecute(r) +} + +/* +TriggerDatabaseRestore Trigger restore for a specific Database + +Trigger restore for a specific Database + + @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 databaseName Database Name + @return ApiTriggerDatabaseRestoreRequest +*/ +func (a *DefaultAPIService) TriggerDatabaseRestore(ctx context.Context, projectId string, instanceId string, databaseName string) ApiTriggerDatabaseRestoreRequest { + return ApiTriggerDatabaseRestoreRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + databaseName: databaseName, + } +} + +// Execute executes the request +func (a *DefaultAPIService) TriggerDatabaseRestoreExecute(r ApiTriggerDatabaseRestoreRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.TriggerDatabaseRestore") + if err != nil { + return nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups/databases/{databaseName}/restores" + 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, "{"+"databaseName"+"}", url.PathEscape(parameterValueToString(r.databaseName, "databaseName")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.triggerDatabaseRestorePayload == nil { + return nil, reportError("triggerDatabaseRestorePayload 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{"*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.triggerDatabaseRestorePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, 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() (*UpdateInstanceResponse, *http.Response, error) { + return r.ApiService.UpdateInstanceExecute(r) +} + +/* +UpdateInstance Update Instance + +Update available instance of a mssql database. + +**Please note that any changes applied via PUT or PATCH requests will initiate a reboot of the SQL Server Flex 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 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 UpdateInstanceResponse +func (a *DefaultAPIService) UpdateInstanceExecute(r ApiUpdateInstanceRequest) (*UpdateInstanceResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UpdateInstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateInstance") + if err != nil { + return localVarReturnValue, nil, &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, nil, 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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/services/sqlserverflex/v1api/api_default_mock.go b/services/sqlserverflex/v1api/api_default_mock.go new file mode 100644 index 000000000..8a0a7dff9 --- /dev/null +++ b/services/sqlserverflex/v1api/api_default_mock.go @@ -0,0 +1,592 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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" + "net/http" +) + +// 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 { + // CreateDatabaseExecuteMock can be populated to implement the behavior of the CreateDatabaseExecute function of this mock + CreateDatabaseExecuteMock *func(r ApiCreateDatabaseRequest) (*CreateDatabaseResponse, *http.Response, error) + // CreateInstanceExecuteMock can be populated to implement the behavior of the CreateInstanceExecute function of this mock + CreateInstanceExecuteMock *func(r ApiCreateInstanceRequest) (*CreateInstanceResponse, *http.Response, error) + // CreateUserExecuteMock can be populated to implement the behavior of the CreateUserExecute function of this mock + CreateUserExecuteMock *func(r ApiCreateUserRequest) (*CreateUserResponse, *http.Response, error) + // DeleteDatabaseExecuteMock can be populated to implement the behavior of the DeleteDatabaseExecute function of this mock + DeleteDatabaseExecuteMock *func(r ApiDeleteDatabaseRequest) (*http.Response, error) + // DeleteInstanceExecuteMock can be populated to implement the behavior of the DeleteInstanceExecute function of this mock + DeleteInstanceExecuteMock *func(r ApiDeleteInstanceRequest) (*http.Response, error) + // DeleteUserExecuteMock can be populated to implement the behavior of the DeleteUserExecute function of this mock + DeleteUserExecuteMock *func(r ApiDeleteUserRequest) (*http.Response, error) + // GetBackupExecuteMock can be populated to implement the behavior of the GetBackupExecute function of this mock + GetBackupExecuteMock *func(r ApiGetBackupRequest) (*GetBackupResponse, *http.Response, error) + // GetDatabaseExecuteMock can be populated to implement the behavior of the GetDatabaseExecute function of this mock + GetDatabaseExecuteMock *func(r ApiGetDatabaseRequest) (*GetDatabaseResponse, *http.Response, error) + // GetInstanceExecuteMock can be populated to implement the behavior of the GetInstanceExecute function of this mock + GetInstanceExecuteMock *func(r ApiGetInstanceRequest) (*GetInstanceResponse, *http.Response, error) + // GetUserExecuteMock can be populated to implement the behavior of the GetUserExecute function of this mock + GetUserExecuteMock *func(r ApiGetUserRequest) (*GetUserResponse, *http.Response, error) + // ListBackupsExecuteMock can be populated to implement the behavior of the ListBackupsExecute function of this mock + ListBackupsExecuteMock *func(r ApiListBackupsRequest) (*ListBackupsResponse, *http.Response, error) + // ListCollationsExecuteMock can be populated to implement the behavior of the ListCollationsExecute function of this mock + ListCollationsExecuteMock *func(r ApiListCollationsRequest) (*ListCollationsResponse, *http.Response, error) + // ListCompatibilityExecuteMock can be populated to implement the behavior of the ListCompatibilityExecute function of this mock + ListCompatibilityExecuteMock *func(r ApiListCompatibilityRequest) (*ListCompatibilityResponse, *http.Response, error) + // ListDatabasesExecuteMock can be populated to implement the behavior of the ListDatabasesExecute function of this mock + ListDatabasesExecuteMock *func(r ApiListDatabasesRequest) (*ListDatabasesResponse, *http.Response, error) + // ListFlavorsExecuteMock can be populated to implement the behavior of the ListFlavorsExecute function of this mock + ListFlavorsExecuteMock *func(r ApiListFlavorsRequest) (*ListFlavorsResponse, *http.Response, error) + // ListInstancesExecuteMock can be populated to implement the behavior of the ListInstancesExecute function of this mock + ListInstancesExecuteMock *func(r ApiListInstancesRequest) (*ListInstancesResponse, *http.Response, error) + // ListMetricsExecuteMock can be populated to implement the behavior of the ListMetricsExecute function of this mock + ListMetricsExecuteMock *func(r ApiListMetricsRequest) (*ListMetricsResponse, *http.Response, error) + // ListRestoreJobsExecuteMock can be populated to implement the behavior of the ListRestoreJobsExecute function of this mock + ListRestoreJobsExecuteMock *func(r ApiListRestoreJobsRequest) (*ListRestoreJobsResponse, *http.Response, error) + // ListRolesExecuteMock can be populated to implement the behavior of the ListRolesExecute function of this mock + ListRolesExecuteMock *func(r ApiListRolesRequest) (*ListRolesResponse, *http.Response, error) + // ListStoragesExecuteMock can be populated to implement the behavior of the ListStoragesExecute function of this mock + ListStoragesExecuteMock *func(r ApiListStoragesRequest) (*ListStoragesResponse, *http.Response, error) + // ListUsersExecuteMock can be populated to implement the behavior of the ListUsersExecute function of this mock + ListUsersExecuteMock *func(r ApiListUsersRequest) (*ListUsersResponse, *http.Response, error) + // ListVersionsExecuteMock can be populated to implement the behavior of the ListVersionsExecute function of this mock + ListVersionsExecuteMock *func(r ApiListVersionsRequest) (*ListVersionsResponse, *http.Response, error) + // PartialUpdateInstanceExecuteMock can be populated to implement the behavior of the PartialUpdateInstanceExecute function of this mock + PartialUpdateInstanceExecuteMock *func(r ApiPartialUpdateInstanceRequest) (*UpdateInstanceResponse, *http.Response, error) + // ResetUserExecuteMock can be populated to implement the behavior of the ResetUserExecute function of this mock + ResetUserExecuteMock *func(r ApiResetUserRequest) (*ResetUserResponse, *http.Response, error) + // TriggerDatabaseBackupExecuteMock can be populated to implement the behavior of the TriggerDatabaseBackupExecute function of this mock + TriggerDatabaseBackupExecuteMock *func(r ApiTriggerDatabaseBackupRequest) (*http.Response, error) + // TriggerDatabaseRestoreExecuteMock can be populated to implement the behavior of the TriggerDatabaseRestoreExecute function of this mock + TriggerDatabaseRestoreExecuteMock *func(r ApiTriggerDatabaseRestoreRequest) (*http.Response, error) + // UpdateInstanceExecuteMock can be populated to implement the behavior of the UpdateInstanceExecute function of this mock + UpdateInstanceExecuteMock *func(r ApiUpdateInstanceRequest) (*UpdateInstanceResponse, *http.Response, error) +} + +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) (*CreateDatabaseResponse, *http.Response, error) { + if a.CreateDatabaseExecuteMock == nil { + var localVarReturnValue *CreateDatabaseResponse + return localVarReturnValue, &http.Response{}, 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, *http.Response, error) { + if a.CreateInstanceExecuteMock == nil { + var localVarReturnValue *CreateInstanceResponse + return localVarReturnValue, &http.Response{}, 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, *http.Response, error) { + if a.CreateUserExecuteMock == nil { + var localVarReturnValue *CreateUserResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.CreateUserExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteDatabase(ctx context.Context, projectId string, instanceId string, databaseName string) ApiDeleteDatabaseRequest { + return ApiDeleteDatabaseRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + databaseName: databaseName, + } +} + +// 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) (*http.Response, error) { + if a.DeleteDatabaseExecuteMock == nil { + return &http.Response{}, 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) (*http.Response, error) { + if a.DeleteInstanceExecuteMock == nil { + return &http.Response{}, 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) (*http.Response, error) { + if a.DeleteUserExecuteMock == nil { + return &http.Response{}, nil + } + + return (*a.DeleteUserExecuteMock)(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, *http.Response, error) { + if a.GetBackupExecuteMock == nil { + var localVarReturnValue *GetBackupResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.GetBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetDatabase(ctx context.Context, projectId string, instanceId string, databaseName string) ApiGetDatabaseRequest { + return ApiGetDatabaseRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + databaseName: databaseName, + } +} + +// GetDatabaseExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetDatabaseExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetDatabaseExecute(r ApiGetDatabaseRequest) (*GetDatabaseResponse, *http.Response, error) { + if a.GetDatabaseExecuteMock == nil { + var localVarReturnValue *GetDatabaseResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.GetDatabaseExecuteMock)(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) (*GetInstanceResponse, *http.Response, error) { + if a.GetInstanceExecuteMock == nil { + var localVarReturnValue *GetInstanceResponse + return localVarReturnValue, &http.Response{}, 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, *http.Response, error) { + if a.GetUserExecuteMock == nil { + var localVarReturnValue *GetUserResponse + return localVarReturnValue, &http.Response{}, 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, *http.Response, error) { + if a.ListBackupsExecuteMock == nil { + var localVarReturnValue *ListBackupsResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.ListBackupsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListCollations(ctx context.Context, projectId string, instanceId string) ApiListCollationsRequest { + return ApiListCollationsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// ListCollationsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListCollationsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListCollationsExecute(r ApiListCollationsRequest) (*ListCollationsResponse, *http.Response, error) { + if a.ListCollationsExecuteMock == nil { + var localVarReturnValue *ListCollationsResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.ListCollationsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListCompatibility(ctx context.Context, projectId string, instanceId string) ApiListCompatibilityRequest { + return ApiListCompatibilityRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// ListCompatibilityExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListCompatibilityExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListCompatibilityExecute(r ApiListCompatibilityRequest) (*ListCompatibilityResponse, *http.Response, error) { + if a.ListCompatibilityExecuteMock == nil { + var localVarReturnValue *ListCompatibilityResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.ListCompatibilityExecuteMock)(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) (*ListDatabasesResponse, *http.Response, error) { + if a.ListDatabasesExecuteMock == nil { + var localVarReturnValue *ListDatabasesResponse + return localVarReturnValue, &http.Response{}, 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, *http.Response, error) { + if a.ListFlavorsExecuteMock == nil { + var localVarReturnValue *ListFlavorsResponse + return localVarReturnValue, &http.Response{}, 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, *http.Response, error) { + if a.ListInstancesExecuteMock == nil { + var localVarReturnValue *ListInstancesResponse + return localVarReturnValue, &http.Response{}, 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) (*ListMetricsResponse, *http.Response, error) { + if a.ListMetricsExecuteMock == nil { + var localVarReturnValue *ListMetricsResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.ListMetricsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListRestoreJobs(ctx context.Context, projectId string, instanceId string) ApiListRestoreJobsRequest { + return ApiListRestoreJobsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// ListRestoreJobsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListRestoreJobsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListRestoreJobsExecute(r ApiListRestoreJobsRequest) (*ListRestoreJobsResponse, *http.Response, error) { + if a.ListRestoreJobsExecuteMock == nil { + var localVarReturnValue *ListRestoreJobsResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.ListRestoreJobsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListRoles(ctx context.Context, projectId string, instanceId string) ApiListRolesRequest { + return ApiListRolesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// ListRolesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListRolesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListRolesExecute(r ApiListRolesRequest) (*ListRolesResponse, *http.Response, error) { + if a.ListRolesExecuteMock == nil { + var localVarReturnValue *ListRolesResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.ListRolesExecuteMock)(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, *http.Response, error) { + if a.ListStoragesExecuteMock == nil { + var localVarReturnValue *ListStoragesResponse + return localVarReturnValue, &http.Response{}, 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, *http.Response, error) { + if a.ListUsersExecuteMock == nil { + var localVarReturnValue *ListUsersResponse + return localVarReturnValue, &http.Response{}, 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, *http.Response, error) { + if a.ListVersionsExecuteMock == nil { + var localVarReturnValue *ListVersionsResponse + return localVarReturnValue, &http.Response{}, 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) (*UpdateInstanceResponse, *http.Response, error) { + if a.PartialUpdateInstanceExecuteMock == nil { + var localVarReturnValue *UpdateInstanceResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.PartialUpdateInstanceExecuteMock)(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, *http.Response, error) { + if a.ResetUserExecuteMock == nil { + var localVarReturnValue *ResetUserResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.ResetUserExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) TriggerDatabaseBackup(ctx context.Context, projectId string, instanceId string, databaseName string) ApiTriggerDatabaseBackupRequest { + return ApiTriggerDatabaseBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + databaseName: databaseName, + } +} + +// TriggerDatabaseBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the TriggerDatabaseBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) TriggerDatabaseBackupExecute(r ApiTriggerDatabaseBackupRequest) (*http.Response, error) { + if a.TriggerDatabaseBackupExecuteMock == nil { + return &http.Response{}, nil + } + + return (*a.TriggerDatabaseBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) TriggerDatabaseRestore(ctx context.Context, projectId string, instanceId string, databaseName string) ApiTriggerDatabaseRestoreRequest { + return ApiTriggerDatabaseRestoreRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + databaseName: databaseName, + } +} + +// TriggerDatabaseRestoreExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the TriggerDatabaseRestoreExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) TriggerDatabaseRestoreExecute(r ApiTriggerDatabaseRestoreRequest) (*http.Response, error) { + if a.TriggerDatabaseRestoreExecuteMock == nil { + return &http.Response{}, nil + } + + return (*a.TriggerDatabaseRestoreExecuteMock)(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) (*UpdateInstanceResponse, *http.Response, error) { + if a.UpdateInstanceExecuteMock == nil { + var localVarReturnValue *UpdateInstanceResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.UpdateInstanceExecuteMock)(r) +} diff --git a/services/sqlserverflex/v1api/client.go b/services/sqlserverflex/v1api/client.go new file mode 100644 index 000000000..8e67413c9 --- /dev/null +++ b/services/sqlserverflex/v1api/client.go @@ -0,0 +1,659 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 MSSQL Service 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/sqlserverflex/v1api/configuration.go b/services/sqlserverflex/v1api/configuration.go new file mode 100644 index 000000000..36d04f1a9 --- /dev/null +++ b/services/sqlserverflex/v1api/configuration.go @@ -0,0 +1,41 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex", + Debug: false, + Servers: config.ServerConfigurations{ + { + URL: "https://mssql-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/sqlserverflex/v1api/model_acl.go b/services/sqlserverflex/v1api/model_acl.go new file mode 100644 index 000000000..8dac210bf --- /dev/null +++ b/services/sqlserverflex/v1api/model_acl.go @@ -0,0 +1,125 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v1api/model_backup.go b/services/sqlserverflex/v1api/model_backup.go new file mode 100644 index 000000000..8d4a0cba7 --- /dev/null +++ b/services/sqlserverflex/v1api/model_backup.go @@ -0,0 +1,377 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v1api/model_backup_list_backups_response_grouped.go b/services/sqlserverflex/v1api/model_backup_list_backups_response_grouped.go new file mode 100644 index 000000000..10bc17eb9 --- /dev/null +++ b/services/sqlserverflex/v1api/model_backup_list_backups_response_grouped.go @@ -0,0 +1,161 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 BackupListBackupsResponseGrouped type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BackupListBackupsResponseGrouped{} + +// BackupListBackupsResponseGrouped struct for BackupListBackupsResponseGrouped +type BackupListBackupsResponseGrouped struct { + Backups []Backup `json:"backups,omitempty"` + Name *string `json:"name,omitempty"` +} + +// NewBackupListBackupsResponseGrouped instantiates a new BackupListBackupsResponseGrouped object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBackupListBackupsResponseGrouped() *BackupListBackupsResponseGrouped { + this := BackupListBackupsResponseGrouped{} + return &this +} + +// NewBackupListBackupsResponseGroupedWithDefaults instantiates a new BackupListBackupsResponseGrouped object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBackupListBackupsResponseGroupedWithDefaults() *BackupListBackupsResponseGrouped { + this := BackupListBackupsResponseGrouped{} + return &this +} + +// GetBackups returns the Backups field value if set, zero value otherwise. +func (o *BackupListBackupsResponseGrouped) GetBackups() []Backup { + if o == nil || IsNil(o.Backups) { + var ret []Backup + return ret + } + return o.Backups +} + +// GetBackupsOk returns a tuple with the Backups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BackupListBackupsResponseGrouped) GetBackupsOk() ([]Backup, bool) { + if o == nil || IsNil(o.Backups) { + return nil, false + } + return o.Backups, true +} + +// HasBackups returns a boolean if a field has been set. +func (o *BackupListBackupsResponseGrouped) HasBackups() bool { + if o != nil && !IsNil(o.Backups) { + return true + } + + return false +} + +// SetBackups gets a reference to the given []Backup and assigns it to the Backups field. +func (o *BackupListBackupsResponseGrouped) SetBackups(v []Backup) { + o.Backups = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *BackupListBackupsResponseGrouped) 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 *BackupListBackupsResponseGrouped) 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 *BackupListBackupsResponseGrouped) 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 *BackupListBackupsResponseGrouped) SetName(v string) { + o.Name = &v +} + +func (o BackupListBackupsResponseGrouped) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BackupListBackupsResponseGrouped) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Backups) { + toSerialize["backups"] = o.Backups + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + return toSerialize, nil +} + +type NullableBackupListBackupsResponseGrouped struct { + value *BackupListBackupsResponseGrouped + isSet bool +} + +func (v NullableBackupListBackupsResponseGrouped) Get() *BackupListBackupsResponseGrouped { + return v.value +} + +func (v *NullableBackupListBackupsResponseGrouped) Set(val *BackupListBackupsResponseGrouped) { + v.value = val + v.isSet = true +} + +func (v NullableBackupListBackupsResponseGrouped) IsSet() bool { + return v.isSet +} + +func (v *NullableBackupListBackupsResponseGrouped) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackupListBackupsResponseGrouped(val *BackupListBackupsResponseGrouped) *NullableBackupListBackupsResponseGrouped { + return &NullableBackupListBackupsResponseGrouped{value: val, isSet: true} +} + +func (v NullableBackupListBackupsResponseGrouped) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackupListBackupsResponseGrouped) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v1api/model_create_database_payload.go b/services/sqlserverflex/v1api/model_create_database_payload.go new file mode 100644 index 000000000..29b99549c --- /dev/null +++ b/services/sqlserverflex/v1api/model_create_database_payload.go @@ -0,0 +1,185 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 CreateDatabasePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateDatabasePayload{} + +// CreateDatabasePayload struct for CreateDatabasePayload +type CreateDatabasePayload struct { + Name string `json:"name"` + Options DatabaseDocumentationCreateDatabaseRequestOptions `json:"options"` +} + +type _CreateDatabasePayload CreateDatabasePayload + +// 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(name string, options DatabaseDocumentationCreateDatabaseRequestOptions) *CreateDatabasePayload { + this := CreateDatabasePayload{} + this.Name = name + this.Options = options + 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 +func (o *CreateDatabasePayload) 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 *CreateDatabasePayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateDatabasePayload) SetName(v string) { + o.Name = v +} + +// GetOptions returns the Options field value +func (o *CreateDatabasePayload) GetOptions() DatabaseDocumentationCreateDatabaseRequestOptions { + if o == nil { + var ret DatabaseDocumentationCreateDatabaseRequestOptions + 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 *CreateDatabasePayload) GetOptionsOk() (*DatabaseDocumentationCreateDatabaseRequestOptions, bool) { + if o == nil { + return nil, false + } + return &o.Options, true +} + +// SetOptions sets field value +func (o *CreateDatabasePayload) SetOptions(v DatabaseDocumentationCreateDatabaseRequestOptions) { + 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{}{} + toSerialize["name"] = o.Name + toSerialize["options"] = o.Options + return toSerialize, nil +} + +func (o *CreateDatabasePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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", + "options", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateDatabasePayload := _CreateDatabasePayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateDatabasePayload) + + if err != nil { + return err + } + + *o = CreateDatabasePayload(varCreateDatabasePayload) + + return err +} + +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/sqlserverflex/v1api/model_create_database_response.go b/services/sqlserverflex/v1api/model_create_database_response.go new file mode 100644 index 000000000..ba8f904cb --- /dev/null +++ b/services/sqlserverflex/v1api/model_create_database_response.go @@ -0,0 +1,125 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 CreateDatabaseResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateDatabaseResponse{} + +// CreateDatabaseResponse struct for CreateDatabaseResponse +type CreateDatabaseResponse struct { + Id *string `json:"id,omitempty"` +} + +// 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() *CreateDatabaseResponse { + this := CreateDatabaseResponse{} + 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 if set, zero value otherwise. +func (o *CreateDatabaseResponse) 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 *CreateDatabaseResponse) 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 *CreateDatabaseResponse) 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 *CreateDatabaseResponse) SetId(v string) { + 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{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + return toSerialize, nil +} + +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/sqlserverflex/v1api/model_create_instance_payload.go b/services/sqlserverflex/v1api/model_create_instance_payload.go new file mode 100644 index 000000000..5438f2edf --- /dev/null +++ b/services/sqlserverflex/v1api/model_create_instance_payload.go @@ -0,0 +1,413 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 is the Access Control List defining the IP ranges allowed to connect to the database + Acl *InstanceDocumentationACL `json:"acl,omitempty"` + // Cronjob for the daily full backup if not provided a job will generated between 00:00 and 04:59 + BackupSchedule *string `json:"backupSchedule,omitempty"` + // Id of the selected flavor + FlavorId string `json:"flavorId"` + // Labels for the instance + Labels map[string]interface{} `json:"labels,omitempty"` + // Name of the instance + Name string `json:"name"` + // Database instance specific options are requested via this field + Options *InstanceDocumentationOptions `json:"options,omitempty"` + // Storage for the instance + Storage *InstanceDocumentationStorage `json:"storage,omitempty"` + // Version of the MSSQL Server + Version *string `json:"version,omitempty"` +} + +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(flavorId string, name string) *CreateInstancePayload { + this := CreateInstancePayload{} + this.FlavorId = flavorId + this.Name = name + var version string = "2022" + 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{} + var version string = "2022" + this.Version = &version + return &this +} + +// GetAcl returns the Acl field value if set, zero value otherwise. +func (o *CreateInstancePayload) GetAcl() InstanceDocumentationACL { + if o == nil || IsNil(o.Acl) { + var ret InstanceDocumentationACL + 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 *CreateInstancePayload) GetAclOk() (*InstanceDocumentationACL, 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 *CreateInstancePayload) HasAcl() bool { + if o != nil && !IsNil(o.Acl) { + return true + } + + return false +} + +// SetAcl gets a reference to the given InstanceDocumentationACL and assigns it to the Acl field. +func (o *CreateInstancePayload) SetAcl(v InstanceDocumentationACL) { + o.Acl = &v +} + +// GetBackupSchedule returns the BackupSchedule field value if set, zero value otherwise. +func (o *CreateInstancePayload) 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 *CreateInstancePayload) 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 *CreateInstancePayload) 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 *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]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateInstancePayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateInstancePayload) SetLabels(v map[string]interface{}) { + 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 if set, zero value otherwise. +func (o *CreateInstancePayload) GetOptions() InstanceDocumentationOptions { + if o == nil || IsNil(o.Options) { + var ret InstanceDocumentationOptions + 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 *CreateInstancePayload) GetOptionsOk() (*InstanceDocumentationOptions, 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 *CreateInstancePayload) HasOptions() bool { + if o != nil && !IsNil(o.Options) { + return true + } + + return false +} + +// SetOptions gets a reference to the given InstanceDocumentationOptions and assigns it to the Options field. +func (o *CreateInstancePayload) SetOptions(v InstanceDocumentationOptions) { + o.Options = &v +} + +// GetStorage returns the Storage field value if set, zero value otherwise. +func (o *CreateInstancePayload) GetStorage() InstanceDocumentationStorage { + if o == nil || IsNil(o.Storage) { + var ret InstanceDocumentationStorage + 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 *CreateInstancePayload) GetStorageOk() (*InstanceDocumentationStorage, 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 *CreateInstancePayload) HasStorage() bool { + if o != nil && !IsNil(o.Storage) { + return true + } + + return false +} + +// SetStorage gets a reference to the given InstanceDocumentationStorage and assigns it to the Storage field. +func (o *CreateInstancePayload) SetStorage(v InstanceDocumentationStorage) { + o.Storage = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *CreateInstancePayload) 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 *CreateInstancePayload) 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 *CreateInstancePayload) 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 *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{}{} + if !IsNil(o.Acl) { + toSerialize["acl"] = o.Acl + } + if !IsNil(o.BackupSchedule) { + toSerialize["backupSchedule"] = o.BackupSchedule + } + toSerialize["flavorId"] = o.FlavorId + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + if !IsNil(o.Options) { + toSerialize["options"] = o.Options + } + if !IsNil(o.Storage) { + toSerialize["storage"] = o.Storage + } + if !IsNil(o.Version) { + 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{ + "flavorId", + "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) + } + } + + 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/sqlserverflex/v1api/model_create_instance_response.go b/services/sqlserverflex/v1api/model_create_instance_response.go new file mode 100644 index 000000000..c7cd67330 --- /dev/null +++ b/services/sqlserverflex/v1api/model_create_instance_response.go @@ -0,0 +1,125 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v1api/model_create_user_payload.go b/services/sqlserverflex/v1api/model_create_user_payload.go new file mode 100644 index 000000000..892de80be --- /dev/null +++ b/services/sqlserverflex/v1api/model_create_user_payload.go @@ -0,0 +1,221 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 CreateUserPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateUserPayload{} + +// CreateUserPayload struct for CreateUserPayload +type CreateUserPayload struct { + DefaultDatabase *string `json:"default_database,omitempty"` + Roles []string `json:"roles"` + Username string `json:"username"` +} + +type _CreateUserPayload CreateUserPayload + +// 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(roles []string, username string) *CreateUserPayload { + this := CreateUserPayload{} + this.Roles = roles + this.Username = username + 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 +} + +// GetDefaultDatabase returns the DefaultDatabase field value if set, zero value otherwise. +func (o *CreateUserPayload) GetDefaultDatabase() string { + if o == nil || IsNil(o.DefaultDatabase) { + var ret string + return ret + } + return *o.DefaultDatabase +} + +// GetDefaultDatabaseOk returns a tuple with the DefaultDatabase field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateUserPayload) GetDefaultDatabaseOk() (*string, bool) { + if o == nil || IsNil(o.DefaultDatabase) { + return nil, false + } + return o.DefaultDatabase, true +} + +// HasDefaultDatabase returns a boolean if a field has been set. +func (o *CreateUserPayload) HasDefaultDatabase() bool { + if o != nil && !IsNil(o.DefaultDatabase) { + return true + } + + return false +} + +// SetDefaultDatabase gets a reference to the given string and assigns it to the DefaultDatabase field. +func (o *CreateUserPayload) SetDefaultDatabase(v string) { + o.DefaultDatabase = &v +} + +// GetRoles returns the Roles field value +func (o *CreateUserPayload) 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 *CreateUserPayload) GetRolesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Roles, true +} + +// SetRoles sets field value +func (o *CreateUserPayload) SetRoles(v []string) { + o.Roles = v +} + +// GetUsername returns the Username field value +func (o *CreateUserPayload) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *CreateUserPayload) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +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.DefaultDatabase) { + toSerialize["default_database"] = o.DefaultDatabase + } + toSerialize["roles"] = o.Roles + toSerialize["username"] = o.Username + return toSerialize, nil +} + +func (o *CreateUserPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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", + "username", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateUserPayload := _CreateUserPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateUserPayload) + + if err != nil { + return err + } + + *o = CreateUserPayload(varCreateUserPayload) + + return err +} + +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/sqlserverflex/v1api/model_create_user_response.go b/services/sqlserverflex/v1api/model_create_user_response.go new file mode 100644 index 000000000..b0642862d --- /dev/null +++ b/services/sqlserverflex/v1api/model_create_user_response.go @@ -0,0 +1,125 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 *SingleUser `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() SingleUser { + if o == nil || IsNil(o.Item) { + var ret SingleUser + 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() (*SingleUser, 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 SingleUser and assigns it to the Item field. +func (o *CreateUserResponse) SetItem(v SingleUser) { + 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/sqlserverflex/v1api/model_data_point.go b/services/sqlserverflex/v1api/model_data_point.go new file mode 100644 index 000000000..db6036d21 --- /dev/null +++ b/services/sqlserverflex/v1api/model_data_point.go @@ -0,0 +1,161 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 DataPoint type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DataPoint{} + +// DataPoint struct for DataPoint +type DataPoint struct { + Timestamp *string `json:"timestamp,omitempty"` + Value *float32 `json:"value,omitempty"` +} + +// NewDataPoint instantiates a new DataPoint object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDataPoint() *DataPoint { + this := DataPoint{} + return &this +} + +// NewDataPointWithDefaults instantiates a new DataPoint object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDataPointWithDefaults() *DataPoint { + this := DataPoint{} + return &this +} + +// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +func (o *DataPoint) 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 *DataPoint) 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 *DataPoint) 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 *DataPoint) SetTimestamp(v string) { + o.Timestamp = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *DataPoint) 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 *DataPoint) 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 *DataPoint) 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 *DataPoint) SetValue(v float32) { + o.Value = &v +} + +func (o DataPoint) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DataPoint) 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 NullableDataPoint struct { + value *DataPoint + isSet bool +} + +func (v NullableDataPoint) Get() *DataPoint { + return v.value +} + +func (v *NullableDataPoint) Set(val *DataPoint) { + v.value = val + v.isSet = true +} + +func (v NullableDataPoint) IsSet() bool { + return v.isSet +} + +func (v *NullableDataPoint) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDataPoint(val *DataPoint) *NullableDataPoint { + return &NullableDataPoint{value: val, isSet: true} +} + +func (v NullableDataPoint) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDataPoint) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v1api/model_database.go b/services/sqlserverflex/v1api/model_database.go new file mode 100644 index 000000000..c03cb455c --- /dev/null +++ b/services/sqlserverflex/v1api/model_database.go @@ -0,0 +1,198 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 Database type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Database{} + +// Database struct for Database +type Database struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + // Database specific options + Options map[string]interface{} `json:"options,omitempty"` +} + +// NewDatabase instantiates a new Database object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDatabase() *Database { + this := Database{} + return &this +} + +// NewDatabaseWithDefaults instantiates a new Database object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDatabaseWithDefaults() *Database { + this := Database{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Database) 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 *Database) 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 *Database) 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 *Database) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Database) 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 *Database) 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 *Database) 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 *Database) SetName(v string) { + o.Name = &v +} + +// GetOptions returns the Options field value if set, zero value otherwise. +func (o *Database) 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 *Database) 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 *Database) 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 *Database) SetOptions(v map[string]interface{}) { + o.Options = v +} + +func (o Database) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Database) 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 NullableDatabase struct { + value *Database + isSet bool +} + +func (v NullableDatabase) Get() *Database { + return v.value +} + +func (v *NullableDatabase) Set(val *Database) { + v.value = val + v.isSet = true +} + +func (v NullableDatabase) IsSet() bool { + return v.isSet +} + +func (v *NullableDatabase) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDatabase(val *Database) *NullableDatabase { + return &NullableDatabase{value: val, isSet: true} +} + +func (v NullableDatabase) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDatabase) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v1api/model_database_documentation_create_database_request_options.go b/services/sqlserverflex/v1api/model_database_documentation_create_database_request_options.go new file mode 100644 index 000000000..c199bf39a --- /dev/null +++ b/services/sqlserverflex/v1api/model_database_documentation_create_database_request_options.go @@ -0,0 +1,232 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 DatabaseDocumentationCreateDatabaseRequestOptions type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DatabaseDocumentationCreateDatabaseRequestOptions{} + +// DatabaseDocumentationCreateDatabaseRequestOptions struct for DatabaseDocumentationCreateDatabaseRequestOptions +type DatabaseDocumentationCreateDatabaseRequestOptions struct { + // Collation of the database + Collation *string `json:"collation,omitempty"` + // CompatibilityLevel of the Database. + CompatibilityLevel *string `json:"compatibilityLevel,omitempty"` + // Name of the owner of the database. + Owner string `json:"owner"` +} + +type _DatabaseDocumentationCreateDatabaseRequestOptions DatabaseDocumentationCreateDatabaseRequestOptions + +// NewDatabaseDocumentationCreateDatabaseRequestOptions instantiates a new DatabaseDocumentationCreateDatabaseRequestOptions object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDatabaseDocumentationCreateDatabaseRequestOptions(owner string) *DatabaseDocumentationCreateDatabaseRequestOptions { + this := DatabaseDocumentationCreateDatabaseRequestOptions{} + this.Owner = owner + return &this +} + +// NewDatabaseDocumentationCreateDatabaseRequestOptionsWithDefaults instantiates a new DatabaseDocumentationCreateDatabaseRequestOptions object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDatabaseDocumentationCreateDatabaseRequestOptionsWithDefaults() *DatabaseDocumentationCreateDatabaseRequestOptions { + this := DatabaseDocumentationCreateDatabaseRequestOptions{} + return &this +} + +// GetCollation returns the Collation field value if set, zero value otherwise. +func (o *DatabaseDocumentationCreateDatabaseRequestOptions) GetCollation() string { + if o == nil || IsNil(o.Collation) { + var ret string + return ret + } + return *o.Collation +} + +// GetCollationOk returns a tuple with the Collation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DatabaseDocumentationCreateDatabaseRequestOptions) GetCollationOk() (*string, bool) { + if o == nil || IsNil(o.Collation) { + return nil, false + } + return o.Collation, true +} + +// HasCollation returns a boolean if a field has been set. +func (o *DatabaseDocumentationCreateDatabaseRequestOptions) HasCollation() bool { + if o != nil && !IsNil(o.Collation) { + return true + } + + return false +} + +// SetCollation gets a reference to the given string and assigns it to the Collation field. +func (o *DatabaseDocumentationCreateDatabaseRequestOptions) SetCollation(v string) { + o.Collation = &v +} + +// GetCompatibilityLevel returns the CompatibilityLevel field value if set, zero value otherwise. +func (o *DatabaseDocumentationCreateDatabaseRequestOptions) GetCompatibilityLevel() string { + if o == nil || IsNil(o.CompatibilityLevel) { + var ret string + return ret + } + return *o.CompatibilityLevel +} + +// GetCompatibilityLevelOk returns a tuple with the CompatibilityLevel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DatabaseDocumentationCreateDatabaseRequestOptions) GetCompatibilityLevelOk() (*string, bool) { + if o == nil || IsNil(o.CompatibilityLevel) { + return nil, false + } + return o.CompatibilityLevel, true +} + +// HasCompatibilityLevel returns a boolean if a field has been set. +func (o *DatabaseDocumentationCreateDatabaseRequestOptions) HasCompatibilityLevel() bool { + if o != nil && !IsNil(o.CompatibilityLevel) { + return true + } + + return false +} + +// SetCompatibilityLevel gets a reference to the given string and assigns it to the CompatibilityLevel field. +func (o *DatabaseDocumentationCreateDatabaseRequestOptions) SetCompatibilityLevel(v string) { + o.CompatibilityLevel = &v +} + +// GetOwner returns the Owner field value +func (o *DatabaseDocumentationCreateDatabaseRequestOptions) 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 *DatabaseDocumentationCreateDatabaseRequestOptions) GetOwnerOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Owner, true +} + +// SetOwner sets field value +func (o *DatabaseDocumentationCreateDatabaseRequestOptions) SetOwner(v string) { + o.Owner = v +} + +func (o DatabaseDocumentationCreateDatabaseRequestOptions) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DatabaseDocumentationCreateDatabaseRequestOptions) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Collation) { + toSerialize["collation"] = o.Collation + } + if !IsNil(o.CompatibilityLevel) { + toSerialize["compatibilityLevel"] = o.CompatibilityLevel + } + toSerialize["owner"] = o.Owner + return toSerialize, nil +} + +func (o *DatabaseDocumentationCreateDatabaseRequestOptions) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "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) + } + } + + varDatabaseDocumentationCreateDatabaseRequestOptions := _DatabaseDocumentationCreateDatabaseRequestOptions{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDatabaseDocumentationCreateDatabaseRequestOptions) + + if err != nil { + return err + } + + *o = DatabaseDocumentationCreateDatabaseRequestOptions(varDatabaseDocumentationCreateDatabaseRequestOptions) + + return err +} + +type NullableDatabaseDocumentationCreateDatabaseRequestOptions struct { + value *DatabaseDocumentationCreateDatabaseRequestOptions + isSet bool +} + +func (v NullableDatabaseDocumentationCreateDatabaseRequestOptions) Get() *DatabaseDocumentationCreateDatabaseRequestOptions { + return v.value +} + +func (v *NullableDatabaseDocumentationCreateDatabaseRequestOptions) Set(val *DatabaseDocumentationCreateDatabaseRequestOptions) { + v.value = val + v.isSet = true +} + +func (v NullableDatabaseDocumentationCreateDatabaseRequestOptions) IsSet() bool { + return v.isSet +} + +func (v *NullableDatabaseDocumentationCreateDatabaseRequestOptions) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDatabaseDocumentationCreateDatabaseRequestOptions(val *DatabaseDocumentationCreateDatabaseRequestOptions) *NullableDatabaseDocumentationCreateDatabaseRequestOptions { + return &NullableDatabaseDocumentationCreateDatabaseRequestOptions{value: val, isSet: true} +} + +func (v NullableDatabaseDocumentationCreateDatabaseRequestOptions) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDatabaseDocumentationCreateDatabaseRequestOptions) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v1api/model_database_options.go b/services/sqlserverflex/v1api/model_database_options.go new file mode 100644 index 000000000..96622f3a0 --- /dev/null +++ b/services/sqlserverflex/v1api/model_database_options.go @@ -0,0 +1,200 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 DatabaseOptions type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DatabaseOptions{} + +// DatabaseOptions struct for DatabaseOptions +type DatabaseOptions struct { + // Name of the collation of the database + CollationName *string `json:"collationName,omitempty"` + // CompatibilityLevel of the Database. + CompatibilityLevel *int32 `json:"compatibilityLevel,omitempty"` + // Name of the owner of the database. + Owner *string `json:"owner,omitempty"` +} + +// NewDatabaseOptions instantiates a new DatabaseOptions object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDatabaseOptions() *DatabaseOptions { + this := DatabaseOptions{} + return &this +} + +// NewDatabaseOptionsWithDefaults instantiates a new DatabaseOptions object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDatabaseOptionsWithDefaults() *DatabaseOptions { + this := DatabaseOptions{} + return &this +} + +// GetCollationName returns the CollationName field value if set, zero value otherwise. +func (o *DatabaseOptions) GetCollationName() string { + if o == nil || IsNil(o.CollationName) { + var ret string + return ret + } + return *o.CollationName +} + +// GetCollationNameOk returns a tuple with the CollationName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DatabaseOptions) GetCollationNameOk() (*string, bool) { + if o == nil || IsNil(o.CollationName) { + return nil, false + } + return o.CollationName, true +} + +// HasCollationName returns a boolean if a field has been set. +func (o *DatabaseOptions) HasCollationName() bool { + if o != nil && !IsNil(o.CollationName) { + return true + } + + return false +} + +// SetCollationName gets a reference to the given string and assigns it to the CollationName field. +func (o *DatabaseOptions) SetCollationName(v string) { + o.CollationName = &v +} + +// GetCompatibilityLevel returns the CompatibilityLevel field value if set, zero value otherwise. +func (o *DatabaseOptions) GetCompatibilityLevel() int32 { + if o == nil || IsNil(o.CompatibilityLevel) { + var ret int32 + return ret + } + return *o.CompatibilityLevel +} + +// GetCompatibilityLevelOk returns a tuple with the CompatibilityLevel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DatabaseOptions) GetCompatibilityLevelOk() (*int32, bool) { + if o == nil || IsNil(o.CompatibilityLevel) { + return nil, false + } + return o.CompatibilityLevel, true +} + +// HasCompatibilityLevel returns a boolean if a field has been set. +func (o *DatabaseOptions) HasCompatibilityLevel() bool { + if o != nil && !IsNil(o.CompatibilityLevel) { + return true + } + + return false +} + +// SetCompatibilityLevel gets a reference to the given int32 and assigns it to the CompatibilityLevel field. +func (o *DatabaseOptions) SetCompatibilityLevel(v int32) { + o.CompatibilityLevel = &v +} + +// GetOwner returns the Owner field value if set, zero value otherwise. +func (o *DatabaseOptions) 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 *DatabaseOptions) 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 *DatabaseOptions) 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 *DatabaseOptions) SetOwner(v string) { + o.Owner = &v +} + +func (o DatabaseOptions) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DatabaseOptions) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CollationName) { + toSerialize["collationName"] = o.CollationName + } + if !IsNil(o.CompatibilityLevel) { + toSerialize["compatibilityLevel"] = o.CompatibilityLevel + } + if !IsNil(o.Owner) { + toSerialize["owner"] = o.Owner + } + return toSerialize, nil +} + +type NullableDatabaseOptions struct { + value *DatabaseOptions + isSet bool +} + +func (v NullableDatabaseOptions) Get() *DatabaseOptions { + return v.value +} + +func (v *NullableDatabaseOptions) Set(val *DatabaseOptions) { + v.value = val + v.isSet = true +} + +func (v NullableDatabaseOptions) IsSet() bool { + return v.isSet +} + +func (v *NullableDatabaseOptions) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDatabaseOptions(val *DatabaseOptions) *NullableDatabaseOptions { + return &NullableDatabaseOptions{value: val, isSet: true} +} + +func (v NullableDatabaseOptions) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDatabaseOptions) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v1api/model_flavor.go b/services/sqlserverflex/v1api/model_flavor.go new file mode 100644 index 000000000..47b8d779e --- /dev/null +++ b/services/sqlserverflex/v1api/model_flavor.go @@ -0,0 +1,233 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v1api/model_get_backup_response.go b/services/sqlserverflex/v1api/model_get_backup_response.go new file mode 100644 index 000000000..846491550 --- /dev/null +++ b/services/sqlserverflex/v1api/model_get_backup_response.go @@ -0,0 +1,385 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 { + // Backup end time in UTC + EndTime *string `json:"endTime,omitempty"` + // Backup error + Error *string `json:"error,omitempty"` + // Backup id + Id *string `json:"id,omitempty"` + // Backup labels + Labels []string `json:"labels,omitempty"` + // Backup name + Name *string `json:"name,omitempty"` + // Backup specific options + Options *map[string]string `json:"options,omitempty"` + // Backup size in byte + Size *int32 `json:"size,omitempty"` + // Backup start time in UTC + StartTime *string `json:"startTime,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 +} + +// GetEndTime returns the EndTime field value if set, zero value otherwise. +func (o *GetBackupResponse) 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 *GetBackupResponse) 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 *GetBackupResponse) 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 *GetBackupResponse) SetEndTime(v string) { + o.EndTime = &v +} + +// GetError returns the Error field value if set, zero value otherwise. +func (o *GetBackupResponse) 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 *GetBackupResponse) 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 *GetBackupResponse) 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 *GetBackupResponse) SetError(v string) { + o.Error = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *GetBackupResponse) 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 *GetBackupResponse) 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 *GetBackupResponse) 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 *GetBackupResponse) SetId(v string) { + o.Id = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *GetBackupResponse) 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 *GetBackupResponse) 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 *GetBackupResponse) 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 *GetBackupResponse) SetLabels(v []string) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *GetBackupResponse) 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 *GetBackupResponse) 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 *GetBackupResponse) 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 *GetBackupResponse) SetName(v string) { + o.Name = &v +} + +// GetOptions returns the Options field value if set, zero value otherwise. +func (o *GetBackupResponse) 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 *GetBackupResponse) 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 *GetBackupResponse) 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 *GetBackupResponse) SetOptions(v map[string]string) { + o.Options = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *GetBackupResponse) 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 *GetBackupResponse) 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 *GetBackupResponse) 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 *GetBackupResponse) SetSize(v int32) { + o.Size = &v +} + +// GetStartTime returns the StartTime field value if set, zero value otherwise. +func (o *GetBackupResponse) 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 *GetBackupResponse) 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 *GetBackupResponse) 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 *GetBackupResponse) SetStartTime(v string) { + o.StartTime = &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.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 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/sqlserverflex/v1api/model_get_database_response.go b/services/sqlserverflex/v1api/model_get_database_response.go new file mode 100644 index 000000000..e4eafb00c --- /dev/null +++ b/services/sqlserverflex/v1api/model_get_database_response.go @@ -0,0 +1,125 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 GetDatabaseResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetDatabaseResponse{} + +// GetDatabaseResponse struct for GetDatabaseResponse +type GetDatabaseResponse struct { + Database *SingleDatabase `json:"database,omitempty"` +} + +// 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() *GetDatabaseResponse { + this := GetDatabaseResponse{} + 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 +} + +// GetDatabase returns the Database field value if set, zero value otherwise. +func (o *GetDatabaseResponse) GetDatabase() SingleDatabase { + if o == nil || IsNil(o.Database) { + var ret SingleDatabase + 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 *GetDatabaseResponse) GetDatabaseOk() (*SingleDatabase, 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 *GetDatabaseResponse) HasDatabase() bool { + if o != nil && !IsNil(o.Database) { + return true + } + + return false +} + +// SetDatabase gets a reference to the given SingleDatabase and assigns it to the Database field. +func (o *GetDatabaseResponse) SetDatabase(v SingleDatabase) { + o.Database = &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{}{} + if !IsNil(o.Database) { + toSerialize["database"] = o.Database + } + return toSerialize, nil +} + +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/sqlserverflex/v1api/model_get_instance_response.go b/services/sqlserverflex/v1api/model_get_instance_response.go new file mode 100644 index 000000000..104307f69 --- /dev/null +++ b/services/sqlserverflex/v1api/model_get_instance_response.go @@ -0,0 +1,125 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 GetInstanceResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetInstanceResponse{} + +// GetInstanceResponse struct for GetInstanceResponse +type GetInstanceResponse struct { + Item *Instance `json:"item,omitempty"` +} + +// 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() *GetInstanceResponse { + this := GetInstanceResponse{} + 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 +} + +// GetItem returns the Item field value if set, zero value otherwise. +func (o *GetInstanceResponse) 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 *GetInstanceResponse) 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 *GetInstanceResponse) 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 *GetInstanceResponse) SetItem(v Instance) { + o.Item = &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.Item) { + toSerialize["item"] = o.Item + } + return toSerialize, nil +} + +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/sqlserverflex/v1api/model_get_user_response.go b/services/sqlserverflex/v1api/model_get_user_response.go new file mode 100644 index 000000000..d71e0ff97 --- /dev/null +++ b/services/sqlserverflex/v1api/model_get_user_response.go @@ -0,0 +1,125 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 *UserResponseUser `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() UserResponseUser { + if o == nil || IsNil(o.Item) { + var ret UserResponseUser + 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() (*UserResponseUser, 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 UserResponseUser and assigns it to the Item field. +func (o *GetUserResponse) SetItem(v UserResponseUser) { + 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/sqlserverflex/v1api/model_host.go b/services/sqlserverflex/v1api/model_host.go new file mode 100644 index 000000000..4c23b4b88 --- /dev/null +++ b/services/sqlserverflex/v1api/model_host.go @@ -0,0 +1,161 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 Host type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Host{} + +// Host struct for Host +type Host struct { + HostMetrics []HostMetric `json:"hostMetrics,omitempty"` + Id *string `json:"id,omitempty"` +} + +// NewHost instantiates a new Host object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHost() *Host { + this := Host{} + return &this +} + +// NewHostWithDefaults instantiates a new Host object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHostWithDefaults() *Host { + this := Host{} + return &this +} + +// GetHostMetrics returns the HostMetrics field value if set, zero value otherwise. +func (o *Host) GetHostMetrics() []HostMetric { + if o == nil || IsNil(o.HostMetrics) { + var ret []HostMetric + 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 *Host) GetHostMetricsOk() ([]HostMetric, 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 *Host) HasHostMetrics() bool { + if o != nil && !IsNil(o.HostMetrics) { + return true + } + + return false +} + +// SetHostMetrics gets a reference to the given []HostMetric and assigns it to the HostMetrics field. +func (o *Host) SetHostMetrics(v []HostMetric) { + o.HostMetrics = v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Host) 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 *Host) 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 *Host) 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 *Host) SetId(v string) { + o.Id = &v +} + +func (o Host) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Host) 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 NullableHost struct { + value *Host + isSet bool +} + +func (v NullableHost) Get() *Host { + return v.value +} + +func (v *NullableHost) Set(val *Host) { + v.value = val + v.isSet = true +} + +func (v NullableHost) IsSet() bool { + return v.isSet +} + +func (v *NullableHost) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHost(val *Host) *NullableHost { + return &NullableHost{value: val, isSet: true} +} + +func (v NullableHost) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHost) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v1api/model_host_metric.go b/services/sqlserverflex/v1api/model_host_metric.go new file mode 100644 index 000000000..21c2211fb --- /dev/null +++ b/services/sqlserverflex/v1api/model_host_metric.go @@ -0,0 +1,197 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 HostMetric type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HostMetric{} + +// HostMetric struct for HostMetric +type HostMetric struct { + Datapoints []DataPoint `json:"datapoints,omitempty"` + Name *string `json:"name,omitempty"` + Units *string `json:"units,omitempty"` +} + +// NewHostMetric instantiates a new HostMetric object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHostMetric() *HostMetric { + this := HostMetric{} + return &this +} + +// NewHostMetricWithDefaults instantiates a new HostMetric object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHostMetricWithDefaults() *HostMetric { + this := HostMetric{} + return &this +} + +// GetDatapoints returns the Datapoints field value if set, zero value otherwise. +func (o *HostMetric) GetDatapoints() []DataPoint { + if o == nil || IsNil(o.Datapoints) { + var ret []DataPoint + 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 *HostMetric) GetDatapointsOk() ([]DataPoint, 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 *HostMetric) HasDatapoints() bool { + if o != nil && !IsNil(o.Datapoints) { + return true + } + + return false +} + +// SetDatapoints gets a reference to the given []DataPoint and assigns it to the Datapoints field. +func (o *HostMetric) SetDatapoints(v []DataPoint) { + o.Datapoints = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *HostMetric) 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 *HostMetric) 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 *HostMetric) 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 *HostMetric) SetName(v string) { + o.Name = &v +} + +// GetUnits returns the Units field value if set, zero value otherwise. +func (o *HostMetric) 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 *HostMetric) 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 *HostMetric) 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 *HostMetric) SetUnits(v string) { + o.Units = &v +} + +func (o HostMetric) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HostMetric) 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 NullableHostMetric struct { + value *HostMetric + isSet bool +} + +func (v NullableHostMetric) Get() *HostMetric { + return v.value +} + +func (v *NullableHostMetric) Set(val *HostMetric) { + v.value = val + v.isSet = true +} + +func (v NullableHostMetric) IsSet() bool { + return v.isSet +} + +func (v *NullableHostMetric) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHostMetric(val *HostMetric) *NullableHostMetric { + return &NullableHostMetric{value: val, isSet: true} +} + +func (v NullableHostMetric) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHostMetric) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v1api/model_instance.go b/services/sqlserverflex/v1api/model_instance.go new file mode 100644 index 000000000..985d5aeb7 --- /dev/null +++ b/services/sqlserverflex/v1api/model_instance.go @@ -0,0 +1,449 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v1api/model_instance_documentation_acl.go b/services/sqlserverflex/v1api/model_instance_documentation_acl.go new file mode 100644 index 000000000..2810fe9e4 --- /dev/null +++ b/services/sqlserverflex/v1api/model_instance_documentation_acl.go @@ -0,0 +1,126 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 InstanceDocumentationACL type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceDocumentationACL{} + +// InstanceDocumentationACL struct for InstanceDocumentationACL +type InstanceDocumentationACL struct { + // a simple list with IP addresses with CIDR. + Items []string `json:"items,omitempty"` +} + +// NewInstanceDocumentationACL instantiates a new InstanceDocumentationACL object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceDocumentationACL() *InstanceDocumentationACL { + this := InstanceDocumentationACL{} + return &this +} + +// NewInstanceDocumentationACLWithDefaults instantiates a new InstanceDocumentationACL object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceDocumentationACLWithDefaults() *InstanceDocumentationACL { + this := InstanceDocumentationACL{} + return &this +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *InstanceDocumentationACL) 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 *InstanceDocumentationACL) 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 *InstanceDocumentationACL) 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 *InstanceDocumentationACL) SetItems(v []string) { + o.Items = v +} + +func (o InstanceDocumentationACL) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceDocumentationACL) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Items) { + toSerialize["items"] = o.Items + } + return toSerialize, nil +} + +type NullableInstanceDocumentationACL struct { + value *InstanceDocumentationACL + isSet bool +} + +func (v NullableInstanceDocumentationACL) Get() *InstanceDocumentationACL { + return v.value +} + +func (v *NullableInstanceDocumentationACL) Set(val *InstanceDocumentationACL) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceDocumentationACL) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceDocumentationACL) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceDocumentationACL(val *InstanceDocumentationACL) *NullableInstanceDocumentationACL { + return &NullableInstanceDocumentationACL{value: val, isSet: true} +} + +func (v NullableInstanceDocumentationACL) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceDocumentationACL) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v1api/model_instance_documentation_options.go b/services/sqlserverflex/v1api/model_instance_documentation_options.go new file mode 100644 index 000000000..1084e87c2 --- /dev/null +++ b/services/sqlserverflex/v1api/model_instance_documentation_options.go @@ -0,0 +1,171 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 InstanceDocumentationOptions type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceDocumentationOptions{} + +// InstanceDocumentationOptions struct for InstanceDocumentationOptions +type InstanceDocumentationOptions struct { + // Edition of the MSSQL server instance + Edition *string `json:"edition,omitempty"` + // The days for how long the backup files should be stored before cleaned up. 30 to 365 + RetentionDays *string `json:"retentionDays,omitempty"` +} + +// NewInstanceDocumentationOptions instantiates a new InstanceDocumentationOptions object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceDocumentationOptions() *InstanceDocumentationOptions { + this := InstanceDocumentationOptions{} + var edition string = "developer" + this.Edition = &edition + var retentionDays string = "32" + this.RetentionDays = &retentionDays + return &this +} + +// NewInstanceDocumentationOptionsWithDefaults instantiates a new InstanceDocumentationOptions object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceDocumentationOptionsWithDefaults() *InstanceDocumentationOptions { + this := InstanceDocumentationOptions{} + var edition string = "developer" + this.Edition = &edition + var retentionDays string = "32" + this.RetentionDays = &retentionDays + return &this +} + +// GetEdition returns the Edition field value if set, zero value otherwise. +func (o *InstanceDocumentationOptions) GetEdition() string { + if o == nil || IsNil(o.Edition) { + var ret string + return ret + } + return *o.Edition +} + +// GetEditionOk returns a tuple with the Edition field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceDocumentationOptions) GetEditionOk() (*string, bool) { + if o == nil || IsNil(o.Edition) { + return nil, false + } + return o.Edition, true +} + +// HasEdition returns a boolean if a field has been set. +func (o *InstanceDocumentationOptions) HasEdition() bool { + if o != nil && !IsNil(o.Edition) { + return true + } + + return false +} + +// SetEdition gets a reference to the given string and assigns it to the Edition field. +func (o *InstanceDocumentationOptions) SetEdition(v string) { + o.Edition = &v +} + +// GetRetentionDays returns the RetentionDays field value if set, zero value otherwise. +func (o *InstanceDocumentationOptions) GetRetentionDays() string { + if o == nil || IsNil(o.RetentionDays) { + var ret string + 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 *InstanceDocumentationOptions) GetRetentionDaysOk() (*string, 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 *InstanceDocumentationOptions) HasRetentionDays() bool { + if o != nil && !IsNil(o.RetentionDays) { + return true + } + + return false +} + +// SetRetentionDays gets a reference to the given string and assigns it to the RetentionDays field. +func (o *InstanceDocumentationOptions) SetRetentionDays(v string) { + o.RetentionDays = &v +} + +func (o InstanceDocumentationOptions) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceDocumentationOptions) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Edition) { + toSerialize["edition"] = o.Edition + } + if !IsNil(o.RetentionDays) { + toSerialize["retentionDays"] = o.RetentionDays + } + return toSerialize, nil +} + +type NullableInstanceDocumentationOptions struct { + value *InstanceDocumentationOptions + isSet bool +} + +func (v NullableInstanceDocumentationOptions) Get() *InstanceDocumentationOptions { + return v.value +} + +func (v *NullableInstanceDocumentationOptions) Set(val *InstanceDocumentationOptions) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceDocumentationOptions) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceDocumentationOptions) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceDocumentationOptions(val *InstanceDocumentationOptions) *NullableInstanceDocumentationOptions { + return &NullableInstanceDocumentationOptions{value: val, isSet: true} +} + +func (v NullableInstanceDocumentationOptions) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceDocumentationOptions) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v1api/model_instance_documentation_storage.go b/services/sqlserverflex/v1api/model_instance_documentation_storage.go new file mode 100644 index 000000000..abbd9a8b2 --- /dev/null +++ b/services/sqlserverflex/v1api/model_instance_documentation_storage.go @@ -0,0 +1,167 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 InstanceDocumentationStorage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceDocumentationStorage{} + +// InstanceDocumentationStorage struct for InstanceDocumentationStorage +type InstanceDocumentationStorage struct { + // Class of the instance. + Class *string `json:"class,omitempty"` + // Size of the instance storage in GB + Size *int32 `json:"size,omitempty"` +} + +// NewInstanceDocumentationStorage instantiates a new InstanceDocumentationStorage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceDocumentationStorage() *InstanceDocumentationStorage { + this := InstanceDocumentationStorage{} + var class string = "premium-perf12-stackit" + this.Class = &class + return &this +} + +// NewInstanceDocumentationStorageWithDefaults instantiates a new InstanceDocumentationStorage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceDocumentationStorageWithDefaults() *InstanceDocumentationStorage { + this := InstanceDocumentationStorage{} + var class string = "premium-perf12-stackit" + this.Class = &class + return &this +} + +// GetClass returns the Class field value if set, zero value otherwise. +func (o *InstanceDocumentationStorage) 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 *InstanceDocumentationStorage) 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 *InstanceDocumentationStorage) 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 *InstanceDocumentationStorage) SetClass(v string) { + o.Class = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *InstanceDocumentationStorage) 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 *InstanceDocumentationStorage) 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 *InstanceDocumentationStorage) 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 *InstanceDocumentationStorage) SetSize(v int32) { + o.Size = &v +} + +func (o InstanceDocumentationStorage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceDocumentationStorage) 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 NullableInstanceDocumentationStorage struct { + value *InstanceDocumentationStorage + isSet bool +} + +func (v NullableInstanceDocumentationStorage) Get() *InstanceDocumentationStorage { + return v.value +} + +func (v *NullableInstanceDocumentationStorage) Set(val *InstanceDocumentationStorage) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceDocumentationStorage) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceDocumentationStorage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceDocumentationStorage(val *InstanceDocumentationStorage) *NullableInstanceDocumentationStorage { + return &NullableInstanceDocumentationStorage{value: val, isSet: true} +} + +func (v NullableInstanceDocumentationStorage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceDocumentationStorage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v1api/model_instance_error.go b/services/sqlserverflex/v1api/model_instance_error.go new file mode 100644 index 000000000..48c7a4421 --- /dev/null +++ b/services/sqlserverflex/v1api/model_instance_error.go @@ -0,0 +1,233 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 InstanceError type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceError{} + +// InstanceError struct for InstanceError +type InstanceError struct { + Code *int32 `json:"code,omitempty"` + Fields *map[string][]string `json:"fields,omitempty"` + Message *string `json:"message,omitempty"` + Type *Type `json:"type,omitempty"` +} + +// NewInstanceError instantiates a new InstanceError object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceError() *InstanceError { + this := InstanceError{} + return &this +} + +// NewInstanceErrorWithDefaults instantiates a new InstanceError object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceErrorWithDefaults() *InstanceError { + this := InstanceError{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *InstanceError) 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 *InstanceError) 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 *InstanceError) 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 *InstanceError) SetCode(v int32) { + o.Code = &v +} + +// GetFields returns the Fields field value if set, zero value otherwise. +func (o *InstanceError) 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 *InstanceError) 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 *InstanceError) 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 *InstanceError) SetFields(v map[string][]string) { + o.Fields = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *InstanceError) 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 *InstanceError) 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 *InstanceError) 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 *InstanceError) SetMessage(v string) { + o.Message = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *InstanceError) GetType() Type { + if o == nil || IsNil(o.Type) { + var ret Type + 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 *InstanceError) GetTypeOk() (*Type, 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 *InstanceError) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given Type and assigns it to the Type field. +func (o *InstanceError) SetType(v Type) { + o.Type = &v +} + +func (o InstanceError) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceError) 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 NullableInstanceError struct { + value *InstanceError + isSet bool +} + +func (v NullableInstanceError) Get() *InstanceError { + return v.value +} + +func (v *NullableInstanceError) Set(val *InstanceError) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceError) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceError(val *InstanceError) *NullableInstanceError { + return &NullableInstanceError{value: val, isSet: true} +} + +func (v NullableInstanceError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v1api/model_instance_flavor_entry.go b/services/sqlserverflex/v1api/model_instance_flavor_entry.go new file mode 100644 index 000000000..b3f678df2 --- /dev/null +++ b/services/sqlserverflex/v1api/model_instance_flavor_entry.go @@ -0,0 +1,269 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 InstanceFlavorEntry type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceFlavorEntry{} + +// InstanceFlavorEntry struct for InstanceFlavorEntry +type InstanceFlavorEntry struct { + Categories *string `json:"categories,omitempty"` + Cpu *int32 `json:"cpu,omitempty"` + Description *string `json:"description,omitempty"` + Id *string `json:"id,omitempty"` + Memory *int32 `json:"memory,omitempty"` +} + +// NewInstanceFlavorEntry instantiates a new InstanceFlavorEntry object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceFlavorEntry() *InstanceFlavorEntry { + this := InstanceFlavorEntry{} + return &this +} + +// NewInstanceFlavorEntryWithDefaults instantiates a new InstanceFlavorEntry object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceFlavorEntryWithDefaults() *InstanceFlavorEntry { + this := InstanceFlavorEntry{} + return &this +} + +// GetCategories returns the Categories field value if set, zero value otherwise. +func (o *InstanceFlavorEntry) GetCategories() string { + if o == nil || IsNil(o.Categories) { + var ret string + return ret + } + return *o.Categories +} + +// GetCategoriesOk returns a tuple with the Categories field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceFlavorEntry) GetCategoriesOk() (*string, bool) { + if o == nil || IsNil(o.Categories) { + return nil, false + } + return o.Categories, true +} + +// HasCategories returns a boolean if a field has been set. +func (o *InstanceFlavorEntry) HasCategories() bool { + if o != nil && !IsNil(o.Categories) { + return true + } + + return false +} + +// SetCategories gets a reference to the given string and assigns it to the Categories field. +func (o *InstanceFlavorEntry) SetCategories(v string) { + o.Categories = &v +} + +// GetCpu returns the Cpu field value if set, zero value otherwise. +func (o *InstanceFlavorEntry) 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 *InstanceFlavorEntry) 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 *InstanceFlavorEntry) 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 *InstanceFlavorEntry) SetCpu(v int32) { + o.Cpu = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *InstanceFlavorEntry) 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 *InstanceFlavorEntry) 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 *InstanceFlavorEntry) 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 *InstanceFlavorEntry) SetDescription(v string) { + o.Description = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *InstanceFlavorEntry) 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 *InstanceFlavorEntry) 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 *InstanceFlavorEntry) 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 *InstanceFlavorEntry) SetId(v string) { + o.Id = &v +} + +// GetMemory returns the Memory field value if set, zero value otherwise. +func (o *InstanceFlavorEntry) 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 *InstanceFlavorEntry) 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 *InstanceFlavorEntry) 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 *InstanceFlavorEntry) SetMemory(v int32) { + o.Memory = &v +} + +func (o InstanceFlavorEntry) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceFlavorEntry) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Categories) { + toSerialize["categories"] = o.Categories + } + 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 NullableInstanceFlavorEntry struct { + value *InstanceFlavorEntry + isSet bool +} + +func (v NullableInstanceFlavorEntry) Get() *InstanceFlavorEntry { + return v.value +} + +func (v *NullableInstanceFlavorEntry) Set(val *InstanceFlavorEntry) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceFlavorEntry) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceFlavorEntry) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceFlavorEntry(val *InstanceFlavorEntry) *NullableInstanceFlavorEntry { + return &NullableInstanceFlavorEntry{value: val, isSet: true} +} + +func (v NullableInstanceFlavorEntry) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceFlavorEntry) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v1api/model_instance_list_instance.go b/services/sqlserverflex/v1api/model_instance_list_instance.go new file mode 100644 index 000000000..fb46500c5 --- /dev/null +++ b/services/sqlserverflex/v1api/model_instance_list_instance.go @@ -0,0 +1,197 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v1api/model_instance_list_user.go b/services/sqlserverflex/v1api/model_instance_list_user.go new file mode 100644 index 000000000..8af93193f --- /dev/null +++ b/services/sqlserverflex/v1api/model_instance_list_user.go @@ -0,0 +1,161 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 InstanceListUser type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceListUser{} + +// InstanceListUser struct for InstanceListUser +type InstanceListUser struct { + Id *string `json:"id,omitempty"` + Username *string `json:"username,omitempty"` +} + +// NewInstanceListUser instantiates a new InstanceListUser object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceListUser() *InstanceListUser { + this := InstanceListUser{} + return &this +} + +// NewInstanceListUserWithDefaults instantiates a new InstanceListUser object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceListUserWithDefaults() *InstanceListUser { + this := InstanceListUser{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *InstanceListUser) 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 *InstanceListUser) 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 *InstanceListUser) 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 *InstanceListUser) SetId(v string) { + o.Id = &v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *InstanceListUser) 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 *InstanceListUser) 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 *InstanceListUser) 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 *InstanceListUser) SetUsername(v string) { + o.Username = &v +} + +func (o InstanceListUser) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceListUser) 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 NullableInstanceListUser struct { + value *InstanceListUser + isSet bool +} + +func (v NullableInstanceListUser) Get() *InstanceListUser { + return v.value +} + +func (v *NullableInstanceListUser) Set(val *InstanceListUser) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceListUser) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceListUser) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceListUser(val *InstanceListUser) *NullableInstanceListUser { + return &NullableInstanceListUser{value: val, isSet: true} +} + +func (v NullableInstanceListUser) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceListUser) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v1api/model_list_backups_response.go b/services/sqlserverflex/v1api/model_list_backups_response.go new file mode 100644 index 000000000..3899e0648 --- /dev/null +++ b/services/sqlserverflex/v1api/model_list_backups_response.go @@ -0,0 +1,125 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 { + Databases []BackupListBackupsResponseGrouped `json:"databases,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 +} + +// GetDatabases returns the Databases field value if set, zero value otherwise. +func (o *ListBackupsResponse) GetDatabases() []BackupListBackupsResponseGrouped { + if o == nil || IsNil(o.Databases) { + var ret []BackupListBackupsResponseGrouped + 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 *ListBackupsResponse) GetDatabasesOk() ([]BackupListBackupsResponseGrouped, 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 *ListBackupsResponse) HasDatabases() bool { + if o != nil && !IsNil(o.Databases) { + return true + } + + return false +} + +// SetDatabases gets a reference to the given []BackupListBackupsResponseGrouped and assigns it to the Databases field. +func (o *ListBackupsResponse) SetDatabases(v []BackupListBackupsResponseGrouped) { + o.Databases = 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.Databases) { + toSerialize["databases"] = o.Databases + } + 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/sqlserverflex/v1api/model_list_collations_response.go b/services/sqlserverflex/v1api/model_list_collations_response.go new file mode 100644 index 000000000..658819055 --- /dev/null +++ b/services/sqlserverflex/v1api/model_list_collations_response.go @@ -0,0 +1,125 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 ListCollationsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListCollationsResponse{} + +// ListCollationsResponse struct for ListCollationsResponse +type ListCollationsResponse struct { + Collations []MssqlDatabaseCollation `json:"collations,omitempty"` +} + +// NewListCollationsResponse instantiates a new ListCollationsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListCollationsResponse() *ListCollationsResponse { + this := ListCollationsResponse{} + return &this +} + +// NewListCollationsResponseWithDefaults instantiates a new ListCollationsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListCollationsResponseWithDefaults() *ListCollationsResponse { + this := ListCollationsResponse{} + return &this +} + +// GetCollations returns the Collations field value if set, zero value otherwise. +func (o *ListCollationsResponse) GetCollations() []MssqlDatabaseCollation { + if o == nil || IsNil(o.Collations) { + var ret []MssqlDatabaseCollation + return ret + } + return o.Collations +} + +// GetCollationsOk returns a tuple with the Collations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListCollationsResponse) GetCollationsOk() ([]MssqlDatabaseCollation, bool) { + if o == nil || IsNil(o.Collations) { + return nil, false + } + return o.Collations, true +} + +// HasCollations returns a boolean if a field has been set. +func (o *ListCollationsResponse) HasCollations() bool { + if o != nil && !IsNil(o.Collations) { + return true + } + + return false +} + +// SetCollations gets a reference to the given []MssqlDatabaseCollation and assigns it to the Collations field. +func (o *ListCollationsResponse) SetCollations(v []MssqlDatabaseCollation) { + o.Collations = v +} + +func (o ListCollationsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListCollationsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Collations) { + toSerialize["collations"] = o.Collations + } + return toSerialize, nil +} + +type NullableListCollationsResponse struct { + value *ListCollationsResponse + isSet bool +} + +func (v NullableListCollationsResponse) Get() *ListCollationsResponse { + return v.value +} + +func (v *NullableListCollationsResponse) Set(val *ListCollationsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListCollationsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListCollationsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListCollationsResponse(val *ListCollationsResponse) *NullableListCollationsResponse { + return &NullableListCollationsResponse{value: val, isSet: true} +} + +func (v NullableListCollationsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListCollationsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v1api/model_list_compatibility_response.go b/services/sqlserverflex/v1api/model_list_compatibility_response.go new file mode 100644 index 000000000..b222fa8f6 --- /dev/null +++ b/services/sqlserverflex/v1api/model_list_compatibility_response.go @@ -0,0 +1,125 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 ListCompatibilityResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListCompatibilityResponse{} + +// ListCompatibilityResponse struct for ListCompatibilityResponse +type ListCompatibilityResponse struct { + Compatibilities []MssqlDatabaseCompatibility `json:"compatibilities,omitempty"` +} + +// NewListCompatibilityResponse instantiates a new ListCompatibilityResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListCompatibilityResponse() *ListCompatibilityResponse { + this := ListCompatibilityResponse{} + return &this +} + +// NewListCompatibilityResponseWithDefaults instantiates a new ListCompatibilityResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListCompatibilityResponseWithDefaults() *ListCompatibilityResponse { + this := ListCompatibilityResponse{} + return &this +} + +// GetCompatibilities returns the Compatibilities field value if set, zero value otherwise. +func (o *ListCompatibilityResponse) GetCompatibilities() []MssqlDatabaseCompatibility { + if o == nil || IsNil(o.Compatibilities) { + var ret []MssqlDatabaseCompatibility + return ret + } + return o.Compatibilities +} + +// GetCompatibilitiesOk returns a tuple with the Compatibilities field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListCompatibilityResponse) GetCompatibilitiesOk() ([]MssqlDatabaseCompatibility, bool) { + if o == nil || IsNil(o.Compatibilities) { + return nil, false + } + return o.Compatibilities, true +} + +// HasCompatibilities returns a boolean if a field has been set. +func (o *ListCompatibilityResponse) HasCompatibilities() bool { + if o != nil && !IsNil(o.Compatibilities) { + return true + } + + return false +} + +// SetCompatibilities gets a reference to the given []MssqlDatabaseCompatibility and assigns it to the Compatibilities field. +func (o *ListCompatibilityResponse) SetCompatibilities(v []MssqlDatabaseCompatibility) { + o.Compatibilities = v +} + +func (o ListCompatibilityResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListCompatibilityResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Compatibilities) { + toSerialize["compatibilities"] = o.Compatibilities + } + return toSerialize, nil +} + +type NullableListCompatibilityResponse struct { + value *ListCompatibilityResponse + isSet bool +} + +func (v NullableListCompatibilityResponse) Get() *ListCompatibilityResponse { + return v.value +} + +func (v *NullableListCompatibilityResponse) Set(val *ListCompatibilityResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListCompatibilityResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListCompatibilityResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListCompatibilityResponse(val *ListCompatibilityResponse) *NullableListCompatibilityResponse { + return &NullableListCompatibilityResponse{value: val, isSet: true} +} + +func (v NullableListCompatibilityResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListCompatibilityResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v1api/model_list_databases_response.go b/services/sqlserverflex/v1api/model_list_databases_response.go new file mode 100644 index 000000000..d4f338d8c --- /dev/null +++ b/services/sqlserverflex/v1api/model_list_databases_response.go @@ -0,0 +1,125 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 ListDatabasesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListDatabasesResponse{} + +// ListDatabasesResponse struct for ListDatabasesResponse +type ListDatabasesResponse struct { + Databases []Database `json:"databases,omitempty"` +} + +// 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() *ListDatabasesResponse { + this := ListDatabasesResponse{} + 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 if set, zero value otherwise. +func (o *ListDatabasesResponse) GetDatabases() []Database { + if o == nil || IsNil(o.Databases) { + var ret []Database + 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 *ListDatabasesResponse) GetDatabasesOk() ([]Database, 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 *ListDatabasesResponse) HasDatabases() bool { + if o != nil && !IsNil(o.Databases) { + return true + } + + return false +} + +// SetDatabases gets a reference to the given []Database and assigns it to the Databases field. +func (o *ListDatabasesResponse) SetDatabases(v []Database) { + o.Databases = 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{}{} + if !IsNil(o.Databases) { + toSerialize["databases"] = o.Databases + } + return toSerialize, nil +} + +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/sqlserverflex/v1api/model_list_flavors_response.go b/services/sqlserverflex/v1api/model_list_flavors_response.go new file mode 100644 index 000000000..064c08126 --- /dev/null +++ b/services/sqlserverflex/v1api/model_list_flavors_response.go @@ -0,0 +1,125 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 []InstanceFlavorEntry `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() []InstanceFlavorEntry { + if o == nil || IsNil(o.Flavors) { + var ret []InstanceFlavorEntry + 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() ([]InstanceFlavorEntry, 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 []InstanceFlavorEntry and assigns it to the Flavors field. +func (o *ListFlavorsResponse) SetFlavors(v []InstanceFlavorEntry) { + 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/sqlserverflex/v1api/model_list_instances_response.go b/services/sqlserverflex/v1api/model_list_instances_response.go new file mode 100644 index 000000000..e069cc7f2 --- /dev/null +++ b/services/sqlserverflex/v1api/model_list_instances_response.go @@ -0,0 +1,161 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v1api/model_list_metrics_response.go b/services/sqlserverflex/v1api/model_list_metrics_response.go new file mode 100644 index 000000000..6b8237643 --- /dev/null +++ b/services/sqlserverflex/v1api/model_list_metrics_response.go @@ -0,0 +1,125 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 ListMetricsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListMetricsResponse{} + +// ListMetricsResponse struct for ListMetricsResponse +type ListMetricsResponse struct { + Hosts []Host `json:"hosts,omitempty"` +} + +// NewListMetricsResponse instantiates a new ListMetricsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListMetricsResponse() *ListMetricsResponse { + this := ListMetricsResponse{} + return &this +} + +// NewListMetricsResponseWithDefaults instantiates a new ListMetricsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListMetricsResponseWithDefaults() *ListMetricsResponse { + this := ListMetricsResponse{} + return &this +} + +// GetHosts returns the Hosts field value if set, zero value otherwise. +func (o *ListMetricsResponse) GetHosts() []Host { + if o == nil || IsNil(o.Hosts) { + var ret []Host + 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 *ListMetricsResponse) GetHostsOk() ([]Host, 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 *ListMetricsResponse) HasHosts() bool { + if o != nil && !IsNil(o.Hosts) { + return true + } + + return false +} + +// SetHosts gets a reference to the given []Host and assigns it to the Hosts field. +func (o *ListMetricsResponse) SetHosts(v []Host) { + o.Hosts = v +} + +func (o ListMetricsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListMetricsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Hosts) { + toSerialize["hosts"] = o.Hosts + } + return toSerialize, nil +} + +type NullableListMetricsResponse struct { + value *ListMetricsResponse + isSet bool +} + +func (v NullableListMetricsResponse) Get() *ListMetricsResponse { + return v.value +} + +func (v *NullableListMetricsResponse) Set(val *ListMetricsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListMetricsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListMetricsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListMetricsResponse(val *ListMetricsResponse) *NullableListMetricsResponse { + return &NullableListMetricsResponse{value: val, isSet: true} +} + +func (v NullableListMetricsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListMetricsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v1api/model_list_restore_jobs_response.go b/services/sqlserverflex/v1api/model_list_restore_jobs_response.go new file mode 100644 index 000000000..865e253b1 --- /dev/null +++ b/services/sqlserverflex/v1api/model_list_restore_jobs_response.go @@ -0,0 +1,125 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 ListRestoreJobsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListRestoreJobsResponse{} + +// ListRestoreJobsResponse struct for ListRestoreJobsResponse +type ListRestoreJobsResponse struct { + RunningRestores []RestoreRunningRestore `json:"runningRestores,omitempty"` +} + +// NewListRestoreJobsResponse instantiates a new ListRestoreJobsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListRestoreJobsResponse() *ListRestoreJobsResponse { + this := ListRestoreJobsResponse{} + return &this +} + +// NewListRestoreJobsResponseWithDefaults instantiates a new ListRestoreJobsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListRestoreJobsResponseWithDefaults() *ListRestoreJobsResponse { + this := ListRestoreJobsResponse{} + return &this +} + +// GetRunningRestores returns the RunningRestores field value if set, zero value otherwise. +func (o *ListRestoreJobsResponse) GetRunningRestores() []RestoreRunningRestore { + if o == nil || IsNil(o.RunningRestores) { + var ret []RestoreRunningRestore + return ret + } + return o.RunningRestores +} + +// GetRunningRestoresOk returns a tuple with the RunningRestores field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListRestoreJobsResponse) GetRunningRestoresOk() ([]RestoreRunningRestore, bool) { + if o == nil || IsNil(o.RunningRestores) { + return nil, false + } + return o.RunningRestores, true +} + +// HasRunningRestores returns a boolean if a field has been set. +func (o *ListRestoreJobsResponse) HasRunningRestores() bool { + if o != nil && !IsNil(o.RunningRestores) { + return true + } + + return false +} + +// SetRunningRestores gets a reference to the given []RestoreRunningRestore and assigns it to the RunningRestores field. +func (o *ListRestoreJobsResponse) SetRunningRestores(v []RestoreRunningRestore) { + o.RunningRestores = v +} + +func (o ListRestoreJobsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListRestoreJobsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.RunningRestores) { + toSerialize["runningRestores"] = o.RunningRestores + } + return toSerialize, nil +} + +type NullableListRestoreJobsResponse struct { + value *ListRestoreJobsResponse + isSet bool +} + +func (v NullableListRestoreJobsResponse) Get() *ListRestoreJobsResponse { + return v.value +} + +func (v *NullableListRestoreJobsResponse) Set(val *ListRestoreJobsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListRestoreJobsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListRestoreJobsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListRestoreJobsResponse(val *ListRestoreJobsResponse) *NullableListRestoreJobsResponse { + return &NullableListRestoreJobsResponse{value: val, isSet: true} +} + +func (v NullableListRestoreJobsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListRestoreJobsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v1api/model_list_roles_response.go b/services/sqlserverflex/v1api/model_list_roles_response.go new file mode 100644 index 000000000..ed5a69351 --- /dev/null +++ b/services/sqlserverflex/v1api/model_list_roles_response.go @@ -0,0 +1,125 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 ListRolesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListRolesResponse{} + +// ListRolesResponse struct for ListRolesResponse +type ListRolesResponse struct { + Roles []string `json:"roles,omitempty"` +} + +// 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() *ListRolesResponse { + this := ListRolesResponse{} + 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 if set, zero value otherwise. +func (o *ListRolesResponse) 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 *ListRolesResponse) 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 *ListRolesResponse) 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 *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{}{} + if !IsNil(o.Roles) { + toSerialize["roles"] = o.Roles + } + return toSerialize, nil +} + +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/sqlserverflex/v1api/model_list_storages_response.go b/services/sqlserverflex/v1api/model_list_storages_response.go new file mode 100644 index 000000000..b9e10bb87 --- /dev/null +++ b/services/sqlserverflex/v1api/model_list_storages_response.go @@ -0,0 +1,161 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v1api/model_list_users_response.go b/services/sqlserverflex/v1api/model_list_users_response.go new file mode 100644 index 000000000..a18f0cb9c --- /dev/null +++ b/services/sqlserverflex/v1api/model_list_users_response.go @@ -0,0 +1,161 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 []InstanceListUser `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() []InstanceListUser { + if o == nil || IsNil(o.Items) { + var ret []InstanceListUser + 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() ([]InstanceListUser, 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 []InstanceListUser and assigns it to the Items field. +func (o *ListUsersResponse) SetItems(v []InstanceListUser) { + 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/sqlserverflex/v1api/model_list_versions_response.go b/services/sqlserverflex/v1api/model_list_versions_response.go new file mode 100644 index 000000000..8a2aff850 --- /dev/null +++ b/services/sqlserverflex/v1api/model_list_versions_response.go @@ -0,0 +1,125 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v1api/model_mssql_database_collation.go b/services/sqlserverflex/v1api/model_mssql_database_collation.go new file mode 100644 index 000000000..a2b5b8601 --- /dev/null +++ b/services/sqlserverflex/v1api/model_mssql_database_collation.go @@ -0,0 +1,161 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 MssqlDatabaseCollation type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MssqlDatabaseCollation{} + +// MssqlDatabaseCollation struct for MssqlDatabaseCollation +type MssqlDatabaseCollation struct { + CollationName *string `json:"collation_name,omitempty"` + Description *string `json:"description,omitempty"` +} + +// NewMssqlDatabaseCollation instantiates a new MssqlDatabaseCollation object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMssqlDatabaseCollation() *MssqlDatabaseCollation { + this := MssqlDatabaseCollation{} + return &this +} + +// NewMssqlDatabaseCollationWithDefaults instantiates a new MssqlDatabaseCollation object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMssqlDatabaseCollationWithDefaults() *MssqlDatabaseCollation { + this := MssqlDatabaseCollation{} + return &this +} + +// GetCollationName returns the CollationName field value if set, zero value otherwise. +func (o *MssqlDatabaseCollation) GetCollationName() string { + if o == nil || IsNil(o.CollationName) { + var ret string + return ret + } + return *o.CollationName +} + +// GetCollationNameOk returns a tuple with the CollationName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MssqlDatabaseCollation) GetCollationNameOk() (*string, bool) { + if o == nil || IsNil(o.CollationName) { + return nil, false + } + return o.CollationName, true +} + +// HasCollationName returns a boolean if a field has been set. +func (o *MssqlDatabaseCollation) HasCollationName() bool { + if o != nil && !IsNil(o.CollationName) { + return true + } + + return false +} + +// SetCollationName gets a reference to the given string and assigns it to the CollationName field. +func (o *MssqlDatabaseCollation) SetCollationName(v string) { + o.CollationName = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *MssqlDatabaseCollation) 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 *MssqlDatabaseCollation) 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 *MssqlDatabaseCollation) 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 *MssqlDatabaseCollation) SetDescription(v string) { + o.Description = &v +} + +func (o MssqlDatabaseCollation) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MssqlDatabaseCollation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CollationName) { + toSerialize["collation_name"] = o.CollationName + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + return toSerialize, nil +} + +type NullableMssqlDatabaseCollation struct { + value *MssqlDatabaseCollation + isSet bool +} + +func (v NullableMssqlDatabaseCollation) Get() *MssqlDatabaseCollation { + return v.value +} + +func (v *NullableMssqlDatabaseCollation) Set(val *MssqlDatabaseCollation) { + v.value = val + v.isSet = true +} + +func (v NullableMssqlDatabaseCollation) IsSet() bool { + return v.isSet +} + +func (v *NullableMssqlDatabaseCollation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMssqlDatabaseCollation(val *MssqlDatabaseCollation) *NullableMssqlDatabaseCollation { + return &NullableMssqlDatabaseCollation{value: val, isSet: true} +} + +func (v NullableMssqlDatabaseCollation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMssqlDatabaseCollation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v1api/model_mssql_database_compatibility.go b/services/sqlserverflex/v1api/model_mssql_database_compatibility.go new file mode 100644 index 000000000..8be1ef520 --- /dev/null +++ b/services/sqlserverflex/v1api/model_mssql_database_compatibility.go @@ -0,0 +1,161 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 MssqlDatabaseCompatibility type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MssqlDatabaseCompatibility{} + +// MssqlDatabaseCompatibility struct for MssqlDatabaseCompatibility +type MssqlDatabaseCompatibility struct { + CompatibilityLevel *int32 `json:"compatibility_level,omitempty"` + Description *string `json:"description,omitempty"` +} + +// NewMssqlDatabaseCompatibility instantiates a new MssqlDatabaseCompatibility object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMssqlDatabaseCompatibility() *MssqlDatabaseCompatibility { + this := MssqlDatabaseCompatibility{} + return &this +} + +// NewMssqlDatabaseCompatibilityWithDefaults instantiates a new MssqlDatabaseCompatibility object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMssqlDatabaseCompatibilityWithDefaults() *MssqlDatabaseCompatibility { + this := MssqlDatabaseCompatibility{} + return &this +} + +// GetCompatibilityLevel returns the CompatibilityLevel field value if set, zero value otherwise. +func (o *MssqlDatabaseCompatibility) GetCompatibilityLevel() int32 { + if o == nil || IsNil(o.CompatibilityLevel) { + var ret int32 + return ret + } + return *o.CompatibilityLevel +} + +// GetCompatibilityLevelOk returns a tuple with the CompatibilityLevel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MssqlDatabaseCompatibility) GetCompatibilityLevelOk() (*int32, bool) { + if o == nil || IsNil(o.CompatibilityLevel) { + return nil, false + } + return o.CompatibilityLevel, true +} + +// HasCompatibilityLevel returns a boolean if a field has been set. +func (o *MssqlDatabaseCompatibility) HasCompatibilityLevel() bool { + if o != nil && !IsNil(o.CompatibilityLevel) { + return true + } + + return false +} + +// SetCompatibilityLevel gets a reference to the given int32 and assigns it to the CompatibilityLevel field. +func (o *MssqlDatabaseCompatibility) SetCompatibilityLevel(v int32) { + o.CompatibilityLevel = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *MssqlDatabaseCompatibility) 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 *MssqlDatabaseCompatibility) 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 *MssqlDatabaseCompatibility) 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 *MssqlDatabaseCompatibility) SetDescription(v string) { + o.Description = &v +} + +func (o MssqlDatabaseCompatibility) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MssqlDatabaseCompatibility) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CompatibilityLevel) { + toSerialize["compatibility_level"] = o.CompatibilityLevel + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + return toSerialize, nil +} + +type NullableMssqlDatabaseCompatibility struct { + value *MssqlDatabaseCompatibility + isSet bool +} + +func (v NullableMssqlDatabaseCompatibility) Get() *MssqlDatabaseCompatibility { + return v.value +} + +func (v *NullableMssqlDatabaseCompatibility) Set(val *MssqlDatabaseCompatibility) { + v.value = val + v.isSet = true +} + +func (v NullableMssqlDatabaseCompatibility) IsSet() bool { + return v.isSet +} + +func (v *NullableMssqlDatabaseCompatibility) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMssqlDatabaseCompatibility(val *MssqlDatabaseCompatibility) *NullableMssqlDatabaseCompatibility { + return &NullableMssqlDatabaseCompatibility{value: val, isSet: true} +} + +func (v NullableMssqlDatabaseCompatibility) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMssqlDatabaseCompatibility) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v1api/model_partial_update_instance_payload.go b/services/sqlserverflex/v1api/model_partial_update_instance_payload.go new file mode 100644 index 000000000..6b3aeb42f --- /dev/null +++ b/services/sqlserverflex/v1api/model_partial_update_instance_payload.go @@ -0,0 +1,315 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 is the Access Control List defining the IP ranges allowed to connect to the database + Acl *InstanceDocumentationACL `json:"acl,omitempty"` + // Cronjob for the daily full backup if not provided a job will generated between 00:00 and 04:59 + BackupSchedule *string `json:"backupSchedule,omitempty"` + // Id of the selected flavor + FlavorId *string `json:"flavorId,omitempty"` + // Labels for the instance + Labels map[string]interface{} `json:"labels,omitempty"` + // Name of the instance + Name *string `json:"name,omitempty"` + // Version of the MSSQL Server + 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{} + var version string = "2022" + this.Version = &version + 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{} + var version string = "2022" + this.Version = &version + return &this +} + +// GetAcl returns the Acl field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetAcl() InstanceDocumentationACL { + if o == nil || IsNil(o.Acl) { + var ret InstanceDocumentationACL + 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() (*InstanceDocumentationACL, 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 InstanceDocumentationACL and assigns it to the Acl field. +func (o *PartialUpdateInstancePayload) SetAcl(v InstanceDocumentationACL) { + 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]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *PartialUpdateInstancePayload) SetLabels(v map[string]interface{}) { + 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 +} + +// 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.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/sqlserverflex/v1api/model_reset_user_response.go b/services/sqlserverflex/v1api/model_reset_user_response.go new file mode 100644 index 000000000..360cb0aba --- /dev/null +++ b/services/sqlserverflex/v1api/model_reset_user_response.go @@ -0,0 +1,125 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 *SingleUser `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() SingleUser { + if o == nil || IsNil(o.Item) { + var ret SingleUser + 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() (*SingleUser, 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 SingleUser and assigns it to the Item field. +func (o *ResetUserResponse) SetItem(v SingleUser) { + 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/sqlserverflex/v1api/model_restore_running_restore.go b/services/sqlserverflex/v1api/model_restore_running_restore.go new file mode 100644 index 000000000..a322dc87f --- /dev/null +++ b/services/sqlserverflex/v1api/model_restore_running_restore.go @@ -0,0 +1,269 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 RestoreRunningRestore type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RestoreRunningRestore{} + +// RestoreRunningRestore struct for RestoreRunningRestore +type RestoreRunningRestore struct { + Command *string `json:"command,omitempty"` + DatabaseName *string `json:"database_name,omitempty"` + EstimatedCompletionTime *string `json:"estimated_completion_time,omitempty"` + PercentComplete *int32 `json:"percent_complete,omitempty"` + StartTime *string `json:"start_time,omitempty"` +} + +// NewRestoreRunningRestore instantiates a new RestoreRunningRestore object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRestoreRunningRestore() *RestoreRunningRestore { + this := RestoreRunningRestore{} + return &this +} + +// NewRestoreRunningRestoreWithDefaults instantiates a new RestoreRunningRestore object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRestoreRunningRestoreWithDefaults() *RestoreRunningRestore { + this := RestoreRunningRestore{} + return &this +} + +// GetCommand returns the Command field value if set, zero value otherwise. +func (o *RestoreRunningRestore) GetCommand() string { + if o == nil || IsNil(o.Command) { + var ret string + return ret + } + return *o.Command +} + +// GetCommandOk returns a tuple with the Command field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RestoreRunningRestore) GetCommandOk() (*string, bool) { + if o == nil || IsNil(o.Command) { + return nil, false + } + return o.Command, true +} + +// HasCommand returns a boolean if a field has been set. +func (o *RestoreRunningRestore) HasCommand() bool { + if o != nil && !IsNil(o.Command) { + return true + } + + return false +} + +// SetCommand gets a reference to the given string and assigns it to the Command field. +func (o *RestoreRunningRestore) SetCommand(v string) { + o.Command = &v +} + +// GetDatabaseName returns the DatabaseName field value if set, zero value otherwise. +func (o *RestoreRunningRestore) GetDatabaseName() string { + if o == nil || IsNil(o.DatabaseName) { + var ret string + return ret + } + return *o.DatabaseName +} + +// GetDatabaseNameOk returns a tuple with the DatabaseName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RestoreRunningRestore) GetDatabaseNameOk() (*string, bool) { + if o == nil || IsNil(o.DatabaseName) { + return nil, false + } + return o.DatabaseName, true +} + +// HasDatabaseName returns a boolean if a field has been set. +func (o *RestoreRunningRestore) HasDatabaseName() bool { + if o != nil && !IsNil(o.DatabaseName) { + return true + } + + return false +} + +// SetDatabaseName gets a reference to the given string and assigns it to the DatabaseName field. +func (o *RestoreRunningRestore) SetDatabaseName(v string) { + o.DatabaseName = &v +} + +// GetEstimatedCompletionTime returns the EstimatedCompletionTime field value if set, zero value otherwise. +func (o *RestoreRunningRestore) GetEstimatedCompletionTime() string { + if o == nil || IsNil(o.EstimatedCompletionTime) { + var ret string + return ret + } + return *o.EstimatedCompletionTime +} + +// GetEstimatedCompletionTimeOk returns a tuple with the EstimatedCompletionTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RestoreRunningRestore) GetEstimatedCompletionTimeOk() (*string, bool) { + if o == nil || IsNil(o.EstimatedCompletionTime) { + return nil, false + } + return o.EstimatedCompletionTime, true +} + +// HasEstimatedCompletionTime returns a boolean if a field has been set. +func (o *RestoreRunningRestore) HasEstimatedCompletionTime() bool { + if o != nil && !IsNil(o.EstimatedCompletionTime) { + return true + } + + return false +} + +// SetEstimatedCompletionTime gets a reference to the given string and assigns it to the EstimatedCompletionTime field. +func (o *RestoreRunningRestore) SetEstimatedCompletionTime(v string) { + o.EstimatedCompletionTime = &v +} + +// GetPercentComplete returns the PercentComplete field value if set, zero value otherwise. +func (o *RestoreRunningRestore) GetPercentComplete() int32 { + if o == nil || IsNil(o.PercentComplete) { + var ret int32 + return ret + } + return *o.PercentComplete +} + +// GetPercentCompleteOk returns a tuple with the PercentComplete field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RestoreRunningRestore) GetPercentCompleteOk() (*int32, bool) { + if o == nil || IsNil(o.PercentComplete) { + return nil, false + } + return o.PercentComplete, true +} + +// HasPercentComplete returns a boolean if a field has been set. +func (o *RestoreRunningRestore) HasPercentComplete() bool { + if o != nil && !IsNil(o.PercentComplete) { + return true + } + + return false +} + +// SetPercentComplete gets a reference to the given int32 and assigns it to the PercentComplete field. +func (o *RestoreRunningRestore) SetPercentComplete(v int32) { + o.PercentComplete = &v +} + +// GetStartTime returns the StartTime field value if set, zero value otherwise. +func (o *RestoreRunningRestore) 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 *RestoreRunningRestore) 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 *RestoreRunningRestore) 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 *RestoreRunningRestore) SetStartTime(v string) { + o.StartTime = &v +} + +func (o RestoreRunningRestore) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RestoreRunningRestore) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Command) { + toSerialize["command"] = o.Command + } + if !IsNil(o.DatabaseName) { + toSerialize["database_name"] = o.DatabaseName + } + if !IsNil(o.EstimatedCompletionTime) { + toSerialize["estimated_completion_time"] = o.EstimatedCompletionTime + } + if !IsNil(o.PercentComplete) { + toSerialize["percent_complete"] = o.PercentComplete + } + if !IsNil(o.StartTime) { + toSerialize["start_time"] = o.StartTime + } + return toSerialize, nil +} + +type NullableRestoreRunningRestore struct { + value *RestoreRunningRestore + isSet bool +} + +func (v NullableRestoreRunningRestore) Get() *RestoreRunningRestore { + return v.value +} + +func (v *NullableRestoreRunningRestore) Set(val *RestoreRunningRestore) { + v.value = val + v.isSet = true +} + +func (v NullableRestoreRunningRestore) IsSet() bool { + return v.isSet +} + +func (v *NullableRestoreRunningRestore) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRestoreRunningRestore(val *RestoreRunningRestore) *NullableRestoreRunningRestore { + return &NullableRestoreRunningRestore{value: val, isSet: true} +} + +func (v NullableRestoreRunningRestore) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRestoreRunningRestore) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v1api/model_single_database.go b/services/sqlserverflex/v1api/model_single_database.go new file mode 100644 index 000000000..4e842412b --- /dev/null +++ b/services/sqlserverflex/v1api/model_single_database.go @@ -0,0 +1,200 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 SingleDatabase type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SingleDatabase{} + +// SingleDatabase struct for SingleDatabase +type SingleDatabase struct { + // Database id + Id *string `json:"id,omitempty"` + // Database name + Name *string `json:"name,omitempty"` + // Database specific options + Options *DatabaseOptions `json:"options,omitempty"` +} + +// NewSingleDatabase instantiates a new SingleDatabase object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSingleDatabase() *SingleDatabase { + this := SingleDatabase{} + return &this +} + +// NewSingleDatabaseWithDefaults instantiates a new SingleDatabase object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSingleDatabaseWithDefaults() *SingleDatabase { + this := SingleDatabase{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SingleDatabase) 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 *SingleDatabase) 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 *SingleDatabase) 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 *SingleDatabase) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *SingleDatabase) 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 *SingleDatabase) 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 *SingleDatabase) 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 *SingleDatabase) SetName(v string) { + o.Name = &v +} + +// GetOptions returns the Options field value if set, zero value otherwise. +func (o *SingleDatabase) GetOptions() DatabaseOptions { + if o == nil || IsNil(o.Options) { + var ret DatabaseOptions + 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 *SingleDatabase) GetOptionsOk() (*DatabaseOptions, 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 *SingleDatabase) HasOptions() bool { + if o != nil && !IsNil(o.Options) { + return true + } + + return false +} + +// SetOptions gets a reference to the given DatabaseOptions and assigns it to the Options field. +func (o *SingleDatabase) SetOptions(v DatabaseOptions) { + o.Options = &v +} + +func (o SingleDatabase) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SingleDatabase) 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 NullableSingleDatabase struct { + value *SingleDatabase + isSet bool +} + +func (v NullableSingleDatabase) Get() *SingleDatabase { + return v.value +} + +func (v *NullableSingleDatabase) Set(val *SingleDatabase) { + v.value = val + v.isSet = true +} + +func (v NullableSingleDatabase) IsSet() bool { + return v.isSet +} + +func (v *NullableSingleDatabase) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSingleDatabase(val *SingleDatabase) *NullableSingleDatabase { + return &NullableSingleDatabase{value: val, isSet: true} +} + +func (v NullableSingleDatabase) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSingleDatabase) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v1api/model_single_user.go b/services/sqlserverflex/v1api/model_single_user.go new file mode 100644 index 000000000..3c84a0166 --- /dev/null +++ b/services/sqlserverflex/v1api/model_single_user.go @@ -0,0 +1,377 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 SingleUser type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SingleUser{} + +// SingleUser struct for SingleUser +type SingleUser struct { + DefaultDatabase *string `json:"default_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"` +} + +// NewSingleUser instantiates a new SingleUser object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSingleUser() *SingleUser { + this := SingleUser{} + return &this +} + +// NewSingleUserWithDefaults instantiates a new SingleUser object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSingleUserWithDefaults() *SingleUser { + this := SingleUser{} + return &this +} + +// GetDefaultDatabase returns the DefaultDatabase field value if set, zero value otherwise. +func (o *SingleUser) GetDefaultDatabase() string { + if o == nil || IsNil(o.DefaultDatabase) { + var ret string + return ret + } + return *o.DefaultDatabase +} + +// GetDefaultDatabaseOk returns a tuple with the DefaultDatabase field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SingleUser) GetDefaultDatabaseOk() (*string, bool) { + if o == nil || IsNil(o.DefaultDatabase) { + return nil, false + } + return o.DefaultDatabase, true +} + +// HasDefaultDatabase returns a boolean if a field has been set. +func (o *SingleUser) HasDefaultDatabase() bool { + if o != nil && !IsNil(o.DefaultDatabase) { + return true + } + + return false +} + +// SetDefaultDatabase gets a reference to the given string and assigns it to the DefaultDatabase field. +func (o *SingleUser) SetDefaultDatabase(v string) { + o.DefaultDatabase = &v +} + +// GetHost returns the Host field value if set, zero value otherwise. +func (o *SingleUser) 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 *SingleUser) 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 *SingleUser) 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 *SingleUser) SetHost(v string) { + o.Host = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SingleUser) 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 *SingleUser) 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 *SingleUser) 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 *SingleUser) SetId(v string) { + o.Id = &v +} + +// GetPassword returns the Password field value if set, zero value otherwise. +func (o *SingleUser) 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 *SingleUser) 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 *SingleUser) 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 *SingleUser) SetPassword(v string) { + o.Password = &v +} + +// GetPort returns the Port field value if set, zero value otherwise. +func (o *SingleUser) 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 *SingleUser) 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 *SingleUser) 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 *SingleUser) SetPort(v int32) { + o.Port = &v +} + +// GetRoles returns the Roles field value if set, zero value otherwise. +func (o *SingleUser) 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 *SingleUser) 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 *SingleUser) 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 *SingleUser) SetRoles(v []string) { + o.Roles = v +} + +// GetUri returns the Uri field value if set, zero value otherwise. +func (o *SingleUser) 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 *SingleUser) 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 *SingleUser) 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 *SingleUser) SetUri(v string) { + o.Uri = &v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *SingleUser) 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 *SingleUser) 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 *SingleUser) 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 *SingleUser) SetUsername(v string) { + o.Username = &v +} + +func (o SingleUser) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SingleUser) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DefaultDatabase) { + toSerialize["default_database"] = o.DefaultDatabase + } + 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 NullableSingleUser struct { + value *SingleUser + isSet bool +} + +func (v NullableSingleUser) Get() *SingleUser { + return v.value +} + +func (v *NullableSingleUser) Set(val *SingleUser) { + v.value = val + v.isSet = true +} + +func (v NullableSingleUser) IsSet() bool { + return v.isSet +} + +func (v *NullableSingleUser) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSingleUser(val *SingleUser) *NullableSingleUser { + return &NullableSingleUser{value: val, isSet: true} +} + +func (v NullableSingleUser) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSingleUser) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v1api/model_storage.go b/services/sqlserverflex/v1api/model_storage.go new file mode 100644 index 000000000..ea9a94660 --- /dev/null +++ b/services/sqlserverflex/v1api/model_storage.go @@ -0,0 +1,161 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 *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 +} + +// 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() 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.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/sqlserverflex/v1api/model_storage_range.go b/services/sqlserverflex/v1api/model_storage_range.go new file mode 100644 index 000000000..17afe6c19 --- /dev/null +++ b/services/sqlserverflex/v1api/model_storage_range.go @@ -0,0 +1,161 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v1api/model_trigger_database_restore_payload.go b/services/sqlserverflex/v1api/model_trigger_database_restore_payload.go new file mode 100644 index 000000000..a4387343f --- /dev/null +++ b/services/sqlserverflex/v1api/model_trigger_database_restore_payload.go @@ -0,0 +1,187 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 TriggerDatabaseRestorePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TriggerDatabaseRestorePayload{} + +// TriggerDatabaseRestorePayload struct for TriggerDatabaseRestorePayload +type TriggerDatabaseRestorePayload struct { + // Name for the restored database no overwrite allowed at the moment + Name string `json:"name"` + // Time of the restore point formate RFC3339 + RestoreDateTime string `json:"restoreDateTime"` +} + +type _TriggerDatabaseRestorePayload TriggerDatabaseRestorePayload + +// NewTriggerDatabaseRestorePayload instantiates a new TriggerDatabaseRestorePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTriggerDatabaseRestorePayload(name string, restoreDateTime string) *TriggerDatabaseRestorePayload { + this := TriggerDatabaseRestorePayload{} + this.Name = name + this.RestoreDateTime = restoreDateTime + return &this +} + +// NewTriggerDatabaseRestorePayloadWithDefaults instantiates a new TriggerDatabaseRestorePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTriggerDatabaseRestorePayloadWithDefaults() *TriggerDatabaseRestorePayload { + this := TriggerDatabaseRestorePayload{} + return &this +} + +// GetName returns the Name field value +func (o *TriggerDatabaseRestorePayload) 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 *TriggerDatabaseRestorePayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *TriggerDatabaseRestorePayload) SetName(v string) { + o.Name = v +} + +// GetRestoreDateTime returns the RestoreDateTime field value +func (o *TriggerDatabaseRestorePayload) GetRestoreDateTime() string { + if o == nil { + var ret string + return ret + } + + return o.RestoreDateTime +} + +// GetRestoreDateTimeOk returns a tuple with the RestoreDateTime field value +// and a boolean to check if the value has been set. +func (o *TriggerDatabaseRestorePayload) GetRestoreDateTimeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RestoreDateTime, true +} + +// SetRestoreDateTime sets field value +func (o *TriggerDatabaseRestorePayload) SetRestoreDateTime(v string) { + o.RestoreDateTime = v +} + +func (o TriggerDatabaseRestorePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TriggerDatabaseRestorePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["restoreDateTime"] = o.RestoreDateTime + return toSerialize, nil +} + +func (o *TriggerDatabaseRestorePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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", + "restoreDateTime", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTriggerDatabaseRestorePayload := _TriggerDatabaseRestorePayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varTriggerDatabaseRestorePayload) + + if err != nil { + return err + } + + *o = TriggerDatabaseRestorePayload(varTriggerDatabaseRestorePayload) + + return err +} + +type NullableTriggerDatabaseRestorePayload struct { + value *TriggerDatabaseRestorePayload + isSet bool +} + +func (v NullableTriggerDatabaseRestorePayload) Get() *TriggerDatabaseRestorePayload { + return v.value +} + +func (v *NullableTriggerDatabaseRestorePayload) Set(val *TriggerDatabaseRestorePayload) { + v.value = val + v.isSet = true +} + +func (v NullableTriggerDatabaseRestorePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableTriggerDatabaseRestorePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTriggerDatabaseRestorePayload(val *TriggerDatabaseRestorePayload) *NullableTriggerDatabaseRestorePayload { + return &NullableTriggerDatabaseRestorePayload{value: val, isSet: true} +} + +func (v NullableTriggerDatabaseRestorePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTriggerDatabaseRestorePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v1api/model_type.go b/services/sqlserverflex/v1api/model_type.go new file mode 100644 index 000000000..5c5fcd125 --- /dev/null +++ b/services/sqlserverflex/v1api/model_type.go @@ -0,0 +1,119 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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" + "fmt" +) + +// Type the model 'Type' +type Type string + +// List of Type +const ( + TYPE_NOT_FOUND Type = "NotFound" + TYPE_CREATE Type = "Create" + TYPE_READ Type = "Read" + TYPE_DELETE Type = "Delete" + TYPE_UPDATE Type = "Update" + TYPE_VALIDATION Type = "Validation" +) + +// All allowed values of Type enum +var AllowedTypeEnumValues = []Type{ + "NotFound", + "Create", + "Read", + "Delete", + "Update", + "Validation", +} + +func (v *Type) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := Type(value) + for _, existing := range AllowedTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid Type", value) +} + +// NewTypeFromValue returns a pointer to a valid Type +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewTypeFromValue(v string) (*Type, error) { + ev := Type(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for Type: valid values are %v", v, AllowedTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v Type) IsValid() bool { + for _, existing := range AllowedTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Type value +func (v Type) Ptr() *Type { + return &v +} + +type NullableType struct { + value *Type + isSet bool +} + +func (v NullableType) Get() *Type { + return v.value +} + +func (v *NullableType) Set(val *Type) { + v.value = val + v.isSet = true +} + +func (v NullableType) IsSet() bool { + return v.isSet +} + +func (v *NullableType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableType(val *Type) *NullableType { + return &NullableType{value: val, isSet: true} +} + +func (v NullableType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v1api/model_update_instance_payload.go b/services/sqlserverflex/v1api/model_update_instance_payload.go new file mode 100644 index 000000000..110e126f1 --- /dev/null +++ b/services/sqlserverflex/v1api/model_update_instance_payload.go @@ -0,0 +1,305 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 UpdateInstancePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateInstancePayload{} + +// UpdateInstancePayload struct for UpdateInstancePayload +type UpdateInstancePayload struct { + // ACL is the Access Control List defining the IP ranges allowed to connect to the database + Acl InstanceDocumentationACL `json:"acl"` + // Cronjob for the daily full backup if not provided a job will generated between 00:00 and 04:59 + BackupSchedule string `json:"backupSchedule"` + // Id of the selected flavor + FlavorId string `json:"flavorId"` + // Labels for the instance + Labels map[string]interface{} `json:"labels"` + // Name of the instance + Name string `json:"name"` + // Version of the MSSQL Server + Version string `json:"version"` +} + +type _UpdateInstancePayload UpdateInstancePayload + +// 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(acl InstanceDocumentationACL, backupSchedule string, flavorId string, labels map[string]interface{}, name string, version string) *UpdateInstancePayload { + this := UpdateInstancePayload{} + this.Acl = acl + this.BackupSchedule = backupSchedule + this.FlavorId = flavorId + this.Labels = labels + this.Name = name + this.Version = version + 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{} + var version string = "2022" + this.Version = version + return &this +} + +// GetAcl returns the Acl field value +func (o *UpdateInstancePayload) GetAcl() InstanceDocumentationACL { + if o == nil { + var ret InstanceDocumentationACL + 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 *UpdateInstancePayload) GetAclOk() (*InstanceDocumentationACL, bool) { + if o == nil { + return nil, false + } + return &o.Acl, true +} + +// SetAcl sets field value +func (o *UpdateInstancePayload) SetAcl(v InstanceDocumentationACL) { + o.Acl = v +} + +// GetBackupSchedule returns the BackupSchedule field value +func (o *UpdateInstancePayload) 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 *UpdateInstancePayload) GetBackupScheduleOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BackupSchedule, true +} + +// SetBackupSchedule sets field value +func (o *UpdateInstancePayload) SetBackupSchedule(v string) { + o.BackupSchedule = v +} + +// GetFlavorId returns the FlavorId field value +func (o *UpdateInstancePayload) 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 *UpdateInstancePayload) GetFlavorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FlavorId, true +} + +// SetFlavorId sets field value +func (o *UpdateInstancePayload) SetFlavorId(v string) { + o.FlavorId = v +} + +// GetLabels returns the Labels field value +func (o *UpdateInstancePayload) GetLabels() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value +// and a boolean to check if the value has been set. +func (o *UpdateInstancePayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// SetLabels sets field value +func (o *UpdateInstancePayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value +func (o *UpdateInstancePayload) 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 *UpdateInstancePayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *UpdateInstancePayload) SetName(v string) { + o.Name = v +} + +// GetVersion returns the Version field value +func (o *UpdateInstancePayload) 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 *UpdateInstancePayload) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +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{}{} + toSerialize["acl"] = o.Acl + toSerialize["backupSchedule"] = o.BackupSchedule + toSerialize["flavorId"] = o.FlavorId + toSerialize["labels"] = o.Labels + toSerialize["name"] = o.Name + toSerialize["version"] = o.Version + return toSerialize, nil +} + +func (o *UpdateInstancePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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", + "labels", + "name", + "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) + } + } + + varUpdateInstancePayload := _UpdateInstancePayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varUpdateInstancePayload) + + if err != nil { + return err + } + + *o = UpdateInstancePayload(varUpdateInstancePayload) + + return err +} + +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/sqlserverflex/v1api/model_update_instance_response.go b/services/sqlserverflex/v1api/model_update_instance_response.go new file mode 100644 index 000000000..9c3b166be --- /dev/null +++ b/services/sqlserverflex/v1api/model_update_instance_response.go @@ -0,0 +1,125 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 UpdateInstanceResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateInstanceResponse{} + +// UpdateInstanceResponse struct for UpdateInstanceResponse +type UpdateInstanceResponse struct { + Item *Instance `json:"item,omitempty"` +} + +// NewUpdateInstanceResponse instantiates a new UpdateInstanceResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateInstanceResponse() *UpdateInstanceResponse { + this := UpdateInstanceResponse{} + return &this +} + +// NewUpdateInstanceResponseWithDefaults instantiates a new UpdateInstanceResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateInstanceResponseWithDefaults() *UpdateInstanceResponse { + this := UpdateInstanceResponse{} + return &this +} + +// GetItem returns the Item field value if set, zero value otherwise. +func (o *UpdateInstanceResponse) 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 *UpdateInstanceResponse) 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 *UpdateInstanceResponse) 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 *UpdateInstanceResponse) SetItem(v Instance) { + o.Item = &v +} + +func (o UpdateInstanceResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateInstanceResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Item) { + toSerialize["item"] = o.Item + } + return toSerialize, nil +} + +type NullableUpdateInstanceResponse struct { + value *UpdateInstanceResponse + isSet bool +} + +func (v NullableUpdateInstanceResponse) Get() *UpdateInstanceResponse { + return v.value +} + +func (v *NullableUpdateInstanceResponse) Set(val *UpdateInstanceResponse) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateInstanceResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateInstanceResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateInstanceResponse(val *UpdateInstanceResponse) *NullableUpdateInstanceResponse { + return &NullableUpdateInstanceResponse{value: val, isSet: true} +} + +func (v NullableUpdateInstanceResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateInstanceResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v1api/model_user.go b/services/sqlserverflex/v1api/model_user.go new file mode 100644 index 000000000..4344e5a80 --- /dev/null +++ b/services/sqlserverflex/v1api/model_user.go @@ -0,0 +1,377 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v1api/model_user_response_user.go b/services/sqlserverflex/v1api/model_user_response_user.go new file mode 100644 index 000000000..ecb9ab393 --- /dev/null +++ b/services/sqlserverflex/v1api/model_user_response_user.go @@ -0,0 +1,305 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 UserResponseUser type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserResponseUser{} + +// UserResponseUser struct for UserResponseUser +type UserResponseUser struct { + DefaultDatabase *string `json:"default_database,omitempty"` + 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"` +} + +// NewUserResponseUser instantiates a new UserResponseUser object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserResponseUser() *UserResponseUser { + this := UserResponseUser{} + return &this +} + +// NewUserResponseUserWithDefaults instantiates a new UserResponseUser object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserResponseUserWithDefaults() *UserResponseUser { + this := UserResponseUser{} + return &this +} + +// GetDefaultDatabase returns the DefaultDatabase field value if set, zero value otherwise. +func (o *UserResponseUser) GetDefaultDatabase() string { + if o == nil || IsNil(o.DefaultDatabase) { + var ret string + return ret + } + return *o.DefaultDatabase +} + +// GetDefaultDatabaseOk returns a tuple with the DefaultDatabase field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserResponseUser) GetDefaultDatabaseOk() (*string, bool) { + if o == nil || IsNil(o.DefaultDatabase) { + return nil, false + } + return o.DefaultDatabase, true +} + +// HasDefaultDatabase returns a boolean if a field has been set. +func (o *UserResponseUser) HasDefaultDatabase() bool { + if o != nil && !IsNil(o.DefaultDatabase) { + return true + } + + return false +} + +// SetDefaultDatabase gets a reference to the given string and assigns it to the DefaultDatabase field. +func (o *UserResponseUser) SetDefaultDatabase(v string) { + o.DefaultDatabase = &v +} + +// GetHost returns the Host field value if set, zero value otherwise. +func (o *UserResponseUser) 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 *UserResponseUser) 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 *UserResponseUser) 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 *UserResponseUser) SetHost(v string) { + o.Host = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *UserResponseUser) 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 *UserResponseUser) 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 *UserResponseUser) 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 *UserResponseUser) SetId(v string) { + o.Id = &v +} + +// GetPort returns the Port field value if set, zero value otherwise. +func (o *UserResponseUser) 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 *UserResponseUser) 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 *UserResponseUser) 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 *UserResponseUser) SetPort(v int32) { + o.Port = &v +} + +// GetRoles returns the Roles field value if set, zero value otherwise. +func (o *UserResponseUser) 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 *UserResponseUser) 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 *UserResponseUser) 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 *UserResponseUser) SetRoles(v []string) { + o.Roles = v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *UserResponseUser) 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 *UserResponseUser) 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 *UserResponseUser) 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 *UserResponseUser) SetUsername(v string) { + o.Username = &v +} + +func (o UserResponseUser) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserResponseUser) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DefaultDatabase) { + toSerialize["default_database"] = o.DefaultDatabase + } + 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 NullableUserResponseUser struct { + value *UserResponseUser + isSet bool +} + +func (v NullableUserResponseUser) Get() *UserResponseUser { + return v.value +} + +func (v *NullableUserResponseUser) Set(val *UserResponseUser) { + v.value = val + v.isSet = true +} + +func (v NullableUserResponseUser) IsSet() bool { + return v.isSet +} + +func (v *NullableUserResponseUser) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserResponseUser(val *UserResponseUser) *NullableUserResponseUser { + return &NullableUserResponseUser{value: val, isSet: true} +} + +func (v NullableUserResponseUser) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserResponseUser) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v1api/response.go b/services/sqlserverflex/v1api/response.go new file mode 100644 index 000000000..64c8c7b54 --- /dev/null +++ b/services/sqlserverflex/v1api/response.go @@ -0,0 +1,48 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v1api/utils.go b/services/sqlserverflex/v1api/utils.go new file mode 100644 index 000000000..d45d6bc05 --- /dev/null +++ b/services/sqlserverflex/v1api/utils.go @@ -0,0 +1,362 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v2api/api_default.go b/services/sqlserverflex/v2api/api_default.go new file mode 100644 index 000000000..e3c643efb --- /dev/null +++ b/services/sqlserverflex/v2api/api_default.go @@ -0,0 +1,4850 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 { + + /* + CreateDatabase Create a Database + + Create a 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 region The region which should be addressed + @return ApiCreateDatabaseRequest + */ + CreateDatabase(ctx context.Context, projectId string, instanceId string, region string) ApiCreateDatabaseRequest + + // CreateDatabaseExecute executes the request + // @return CreateDatabaseResponse + CreateDatabaseExecute(r ApiCreateDatabaseRequest) (*CreateDatabaseResponse, *http.Response, error) + + /* + CreateInstance Create Instance + + Create a new instance of a sqlServerCRD 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, *http.Response, 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 + @param region The region which should be addressed + @return ApiCreateUserRequest + */ + CreateUser(ctx context.Context, projectId string, instanceId string, region string) ApiCreateUserRequest + + // CreateUserExecute executes the request + // @return CreateUserResponse + CreateUserExecute(r ApiCreateUserRequest) (*CreateUserResponse, *http.Response, 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 databaseName Database Name + @param region The region which should be addressed + @return ApiDeleteDatabaseRequest + */ + DeleteDatabase(ctx context.Context, projectId string, instanceId string, databaseName string, region string) ApiDeleteDatabaseRequest + + // DeleteDatabaseExecute executes the request + DeleteDatabaseExecute(r ApiDeleteDatabaseRequest) (*http.Response, 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 + @param region The region which should be addressed + @return ApiDeleteInstanceRequest + */ + DeleteInstance(ctx context.Context, projectId string, instanceId string, region string) ApiDeleteInstanceRequest + + // DeleteInstanceExecute executes the request + DeleteInstanceExecute(r ApiDeleteInstanceRequest) (*http.Response, 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 + @param region The region which should be addressed + @return ApiDeleteUserRequest + */ + DeleteUser(ctx context.Context, projectId string, instanceId string, userId string, region string) ApiDeleteUserRequest + + // DeleteUserExecute executes the request + DeleteUserExecute(r ApiDeleteUserRequest) (*http.Response, 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 + @param region The region which should be addressed + @return ApiGetBackupRequest + */ + GetBackup(ctx context.Context, projectId string, instanceId string, backupId string, region string) ApiGetBackupRequest + + // GetBackupExecute executes the request + // @return GetBackupResponse + GetBackupExecute(r ApiGetBackupRequest) (*GetBackupResponse, *http.Response, error) + + /* + GetDatabase Get specific Database + + Get specific available database + + @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 databaseName Database Name + @param region The region which should be addressed + @return ApiGetDatabaseRequest + */ + GetDatabase(ctx context.Context, projectId string, instanceId string, databaseName string, region string) ApiGetDatabaseRequest + + // GetDatabaseExecute executes the request + // @return GetDatabaseResponse + GetDatabaseExecute(r ApiGetDatabaseRequest) (*GetDatabaseResponse, *http.Response, 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 + @param region The region which should be addressed + @return ApiGetInstanceRequest + */ + GetInstance(ctx context.Context, projectId string, instanceId string, region string) ApiGetInstanceRequest + + // GetInstanceExecute executes the request + // @return GetInstanceResponse + GetInstanceExecute(r ApiGetInstanceRequest) (*GetInstanceResponse, *http.Response, 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 + @param region The region which should be addressed + @return ApiGetUserRequest + */ + GetUser(ctx context.Context, projectId string, instanceId string, userId string, region string) ApiGetUserRequest + + // GetUserExecute executes the request + // @return GetUserResponse + GetUserExecute(r ApiGetUserRequest) (*GetUserResponse, *http.Response, 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 + @param region The region which should be addressed + @return ApiListBackupsRequest + */ + ListBackups(ctx context.Context, projectId string, instanceId string, region string) ApiListBackupsRequest + + // ListBackupsExecute executes the request + // @return ListBackupsResponse + ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupsResponse, *http.Response, error) + + /* + ListCollations Get database collation list + + Returns a list of collations + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The ID of the STACKIT project + @param instanceId The ID of the instance + @param region The region which should be addressed + @return ApiListCollationsRequest + */ + ListCollations(ctx context.Context, projectId string, instanceId string, region string) ApiListCollationsRequest + + // ListCollationsExecute executes the request + // @return ListCollationsResponse + ListCollationsExecute(r ApiListCollationsRequest) (*ListCollationsResponse, *http.Response, error) + + /* + ListCompatibility Get database compatibility list + + Returns a list of compatibility levels for creating a new database + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The ID of the STACKIT project + @param instanceId The ID of the instance + @param region The region which should be addressed + @return ApiListCompatibilityRequest + */ + ListCompatibility(ctx context.Context, projectId string, instanceId string, region string) ApiListCompatibilityRequest + + // ListCompatibilityExecute executes the request + // @return ListCompatibilityResponse + ListCompatibilityExecute(r ApiListCompatibilityRequest) (*ListCompatibilityResponse, *http.Response, error) + + /* + ListDatabases Get list of databases + + Get list of all databases in the 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 region The region which should be addressed + @return ApiListDatabasesRequest + */ + ListDatabases(ctx context.Context, projectId string, instanceId string, region string) ApiListDatabasesRequest + + // ListDatabasesExecute executes the request + // @return ListDatabasesResponse + ListDatabasesExecute(r ApiListDatabasesRequest) (*ListDatabasesResponse, *http.Response, 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, *http.Response, 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, *http.Response, 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 instanceId The UUID of the instance. + @param region The region which should be addressed + @param metric The name of the metric. Valid metrics are 'cpu', 'memory', 'data-disk-size', 'data-disk-use','log-disk-size', 'log-disk-use', 'life-expectancy' and 'connections'. + @return ApiListMetricsRequest + */ + ListMetrics(ctx context.Context, projectId string, instanceId string, region string, metric string) ApiListMetricsRequest + + // ListMetricsExecute executes the request + // @return ListMetricsResponse + ListMetricsExecute(r ApiListMetricsRequest) (*ListMetricsResponse, *http.Response, error) + + /* + ListRestoreJobs List current running restore jobs + + List all currently running restore jobs 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 + @param region The region which should be addressed + @return ApiListRestoreJobsRequest + */ + ListRestoreJobs(ctx context.Context, projectId string, instanceId string, region string) ApiListRestoreJobsRequest + + // ListRestoreJobsExecute executes the request + // @return ListRestoreJobsResponse + ListRestoreJobsExecute(r ApiListRestoreJobsRequest) (*ListRestoreJobsResponse, *http.Response, error) + + /* + ListRoles List Roles + + List available roles for an instance that can be assigned to a user + + @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 region The region which should be addressed + @return ApiListRolesRequest + */ + ListRoles(ctx context.Context, projectId string, instanceId string, region string) ApiListRolesRequest + + // ListRolesExecute executes the request + // @return ListRolesResponse + ListRolesExecute(r ApiListRolesRequest) (*ListRolesResponse, *http.Response, 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 + @param region The region which should be addressed + @return ApiListStoragesRequest + */ + ListStorages(ctx context.Context, projectId string, flavorId string, region string) ApiListStoragesRequest + + // ListStoragesExecute executes the request + // @return ListStoragesResponse + ListStoragesExecute(r ApiListStoragesRequest) (*ListStoragesResponse, *http.Response, 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 + @param region The region which should be addressed + @return ApiListUsersRequest + */ + ListUsers(ctx context.Context, projectId string, instanceId string, region string) ApiListUsersRequest + + // ListUsersExecute executes the request + // @return ListUsersResponse + ListUsersExecute(r ApiListUsersRequest) (*ListUsersResponse, *http.Response, error) + + /* + ListVersions Get Versions + + Get available versions for mssql 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, *http.Response, error) + + /* + PartialUpdateInstance Update Instance + + Update available instance of a mssql database. + + **Please note that any changes applied via PUT or PATCH requests will initiate a reboot of the SQL Server Flex 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 region The region which should be addressed + @return ApiPartialUpdateInstanceRequest + */ + PartialUpdateInstance(ctx context.Context, projectId string, instanceId string, region string) ApiPartialUpdateInstanceRequest + + // PartialUpdateInstanceExecute executes the request + // @return UpdateInstanceResponse + PartialUpdateInstanceExecute(r ApiPartialUpdateInstanceRequest) (*UpdateInstanceResponse, *http.Response, error) + + /* + ResetUser Reset User + + Reset user password for a mssql 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 + @param region The region which should be addressed + @return ApiResetUserRequest + */ + ResetUser(ctx context.Context, projectId string, instanceId string, userId string, region string) ApiResetUserRequest + + // ResetUserExecute executes the request + // @return ResetUserResponse + ResetUserExecute(r ApiResetUserRequest) (*ResetUserResponse, *http.Response, error) + + /* + TerminateProject Terminate the Project + + Termination is the deletion of a whole project which causes the deletion of all instances for this project. Only System with permission system.databases-project.remove is able to call this resource + + @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 ApiTerminateProjectRequest + */ + TerminateProject(ctx context.Context, projectId string, region string) ApiTerminateProjectRequest + + // TerminateProjectExecute executes the request + TerminateProjectExecute(r ApiTerminateProjectRequest) (*http.Response, error) + + /* + TriggerDatabaseBackup Trigger backup for a specific Database + + Trigger backup for a specific Database + + @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 databaseName Database Name + @param region The region which should be addressed + @return ApiTriggerDatabaseBackupRequest + */ + TriggerDatabaseBackup(ctx context.Context, projectId string, instanceId string, databaseName string, region string) ApiTriggerDatabaseBackupRequest + + // TriggerDatabaseBackupExecute executes the request + TriggerDatabaseBackupExecute(r ApiTriggerDatabaseBackupRequest) (*http.Response, error) + + /* + TriggerDatabaseRestore Trigger restore for a specific Database + + Trigger restore for a specific Database + + @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 databaseName Database Name + @param region The region which should be addressed + @return ApiTriggerDatabaseRestoreRequest + */ + TriggerDatabaseRestore(ctx context.Context, projectId string, instanceId string, databaseName string, region string) ApiTriggerDatabaseRestoreRequest + + // TriggerDatabaseRestoreExecute executes the request + TriggerDatabaseRestoreExecute(r ApiTriggerDatabaseRestoreRequest) (*http.Response, error) + + /* + UpdateInstance Update Instance + + Update available instance of a mssql database. + + **Please note that any changes applied via PUT or PATCH requests will initiate a reboot of the SQL Server Flex 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 region The region which should be addressed + @return ApiUpdateInstanceRequest + */ + UpdateInstance(ctx context.Context, projectId string, instanceId string, region string) ApiUpdateInstanceRequest + + // UpdateInstanceExecute executes the request + // @return UpdateInstanceResponse + UpdateInstanceExecute(r ApiUpdateInstanceRequest) (*UpdateInstanceResponse, *http.Response, error) +} + +// DefaultAPIService DefaultAPI service +type DefaultAPIService service + +type ApiCreateDatabaseRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + region string + createDatabasePayload *CreateDatabasePayload +} + +// Body +func (r ApiCreateDatabaseRequest) CreateDatabasePayload(createDatabasePayload CreateDatabasePayload) ApiCreateDatabaseRequest { + r.createDatabasePayload = &createDatabasePayload + return r +} + +func (r ApiCreateDatabaseRequest) Execute() (*CreateDatabaseResponse, *http.Response, error) { + return r.ApiService.CreateDatabaseExecute(r) +} + +/* +CreateDatabase Create a Database + +Create a 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 region The region which should be addressed + @return ApiCreateDatabaseRequest +*/ +func (a *DefaultAPIService) CreateDatabase(ctx context.Context, projectId string, instanceId string, region string) ApiCreateDatabaseRequest { + return ApiCreateDatabaseRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + region: region, + } +} + +// Execute executes the request +// +// @return CreateDatabaseResponse +func (a *DefaultAPIService) CreateDatabaseExecute(r ApiCreateDatabaseRequest) (*CreateDatabaseResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateDatabaseResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateDatabase") + if err != nil { + return localVarReturnValue, nil, &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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -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.createDatabasePayload == nil { + return localVarReturnValue, nil, 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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, 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, *http.Response, error) { + return r.ApiService.CreateInstanceExecute(r) +} + +/* +CreateInstance Create Instance + +Create a new instance of a sqlServerCRD 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, *http.Response, 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, nil, &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, nil, 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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCreateUserRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + region string + createUserPayload *CreateUserPayload +} + +// The request body contains a username, a list of roles and database. The possible roles can be fetched from the ListRoles endpoint. +func (r ApiCreateUserRequest) CreateUserPayload(createUserPayload CreateUserPayload) ApiCreateUserRequest { + r.createUserPayload = &createUserPayload + return r +} + +func (r ApiCreateUserRequest) Execute() (*CreateUserResponse, *http.Response, 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 + @param region The region which should be addressed + @return ApiCreateUserRequest +*/ +func (a *DefaultAPIService) CreateUser(ctx context.Context, projectId string, instanceId string, region string) ApiCreateUserRequest { + return ApiCreateUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + region: region, + } +} + +// Execute executes the request +// +// @return CreateUserResponse +func (a *DefaultAPIService) CreateUserExecute(r ApiCreateUserRequest) (*CreateUserResponse, *http.Response, 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, nil, &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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -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.createUserPayload == nil { + return localVarReturnValue, nil, 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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeleteDatabaseRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + databaseName string + region string +} + +func (r ApiDeleteDatabaseRequest) Execute() (*http.Response, 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 databaseName Database Name + @param region The region which should be addressed + @return ApiDeleteDatabaseRequest +*/ +func (a *DefaultAPIService) DeleteDatabase(ctx context.Context, projectId string, instanceId string, databaseName string, region string) ApiDeleteDatabaseRequest { + return ApiDeleteDatabaseRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + databaseName: databaseName, + region: region, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteDatabaseExecute(r ApiDeleteDatabaseRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteDatabase") + if err != nil { + return nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/databases/{databaseName}" + 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, "{"+"databaseName"+"}", url.PathEscape(parameterValueToString(r.databaseName, "databaseName")), -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 nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDeleteInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + region string +} + +func (r ApiDeleteInstanceRequest) Execute() (*http.Response, 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 + @param region The region which should be addressed + @return ApiDeleteInstanceRequest +*/ +func (a *DefaultAPIService) DeleteInstance(ctx context.Context, projectId string, instanceId string, region string) ApiDeleteInstanceRequest { + return ApiDeleteInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + region: region, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteInstanceExecute(r ApiDeleteInstanceRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteInstance") + if err != nil { + return nil, &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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -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 nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDeleteUserRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + userId string + region string +} + +func (r ApiDeleteUserRequest) Execute() (*http.Response, 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 + @param region The region which should be addressed + @return ApiDeleteUserRequest +*/ +func (a *DefaultAPIService) DeleteUser(ctx context.Context, projectId string, instanceId string, userId string, region string) ApiDeleteUserRequest { + return ApiDeleteUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + userId: userId, + region: region, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteUserExecute(r ApiDeleteUserRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteUser") + if err != nil { + return nil, &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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -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 nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiGetBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + backupId string + region string +} + +func (r ApiGetBackupRequest) Execute() (*GetBackupResponse, *http.Response, 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 + @param region The region which should be addressed + @return ApiGetBackupRequest +*/ +func (a *DefaultAPIService) GetBackup(ctx context.Context, projectId string, instanceId string, backupId string, region string) ApiGetBackupRequest { + return ApiGetBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + backupId: backupId, + region: region, + } +} + +// Execute executes the request +// +// @return GetBackupResponse +func (a *DefaultAPIService) GetBackupExecute(r ApiGetBackupRequest) (*GetBackupResponse, *http.Response, 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, nil, &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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetDatabaseRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + databaseName string + region string +} + +func (r ApiGetDatabaseRequest) Execute() (*GetDatabaseResponse, *http.Response, error) { + return r.ApiService.GetDatabaseExecute(r) +} + +/* +GetDatabase Get specific Database + +Get specific available database + + @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 databaseName Database Name + @param region The region which should be addressed + @return ApiGetDatabaseRequest +*/ +func (a *DefaultAPIService) GetDatabase(ctx context.Context, projectId string, instanceId string, databaseName string, region string) ApiGetDatabaseRequest { + return ApiGetDatabaseRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + databaseName: databaseName, + region: region, + } +} + +// Execute executes the request +// +// @return GetDatabaseResponse +func (a *DefaultAPIService) GetDatabaseExecute(r ApiGetDatabaseRequest) (*GetDatabaseResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetDatabaseResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetDatabase") + if err != nil { + return localVarReturnValue, nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/databases/{databaseName}" + 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, "{"+"databaseName"+"}", url.PathEscape(parameterValueToString(r.databaseName, "databaseName")), -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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + region string +} + +func (r ApiGetInstanceRequest) Execute() (*GetInstanceResponse, *http.Response, 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 + @param region The region which should be addressed + @return ApiGetInstanceRequest +*/ +func (a *DefaultAPIService) GetInstance(ctx context.Context, projectId string, instanceId string, region string) ApiGetInstanceRequest { + return ApiGetInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + region: region, + } +} + +// Execute executes the request +// +// @return GetInstanceResponse +func (a *DefaultAPIService) GetInstanceExecute(r ApiGetInstanceRequest) (*GetInstanceResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetInstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetInstance") + if err != nil { + return localVarReturnValue, nil, &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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetUserRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + userId string + region string +} + +func (r ApiGetUserRequest) Execute() (*GetUserResponse, *http.Response, 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 + @param region The region which should be addressed + @return ApiGetUserRequest +*/ +func (a *DefaultAPIService) GetUser(ctx context.Context, projectId string, instanceId string, userId string, region string) ApiGetUserRequest { + return ApiGetUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + userId: userId, + region: region, + } +} + +// Execute executes the request +// +// @return GetUserResponse +func (a *DefaultAPIService) GetUserExecute(r ApiGetUserRequest) (*GetUserResponse, *http.Response, 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, nil, &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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListBackupsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + region string +} + +func (r ApiListBackupsRequest) Execute() (*ListBackupsResponse, *http.Response, 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 + @param region The region which should be addressed + @return ApiListBackupsRequest +*/ +func (a *DefaultAPIService) ListBackups(ctx context.Context, projectId string, instanceId string, region string) ApiListBackupsRequest { + return ApiListBackupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + region: region, + } +} + +// Execute executes the request +// +// @return ListBackupsResponse +func (a *DefaultAPIService) ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupsResponse, *http.Response, 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, nil, &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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListCollationsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + region string +} + +func (r ApiListCollationsRequest) Execute() (*ListCollationsResponse, *http.Response, error) { + return r.ApiService.ListCollationsExecute(r) +} + +/* +ListCollations Get database collation list + +Returns a list of collations + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The ID of the STACKIT project + @param instanceId The ID of the instance + @param region The region which should be addressed + @return ApiListCollationsRequest +*/ +func (a *DefaultAPIService) ListCollations(ctx context.Context, projectId string, instanceId string, region string) ApiListCollationsRequest { + return ApiListCollationsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + region: region, + } +} + +// Execute executes the request +// +// @return ListCollationsResponse +func (a *DefaultAPIService) ListCollationsExecute(r ApiListCollationsRequest) (*ListCollationsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListCollationsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListCollations") + if err != nil { + return localVarReturnValue, nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/collation" + 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, "{"+"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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListCompatibilityRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + region string +} + +func (r ApiListCompatibilityRequest) Execute() (*ListCompatibilityResponse, *http.Response, error) { + return r.ApiService.ListCompatibilityExecute(r) +} + +/* +ListCompatibility Get database compatibility list + +Returns a list of compatibility levels for creating a new database + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The ID of the STACKIT project + @param instanceId The ID of the instance + @param region The region which should be addressed + @return ApiListCompatibilityRequest +*/ +func (a *DefaultAPIService) ListCompatibility(ctx context.Context, projectId string, instanceId string, region string) ApiListCompatibilityRequest { + return ApiListCompatibilityRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + region: region, + } +} + +// Execute executes the request +// +// @return ListCompatibilityResponse +func (a *DefaultAPIService) ListCompatibilityExecute(r ApiListCompatibilityRequest) (*ListCompatibilityResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListCompatibilityResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListCompatibility") + if err != nil { + return localVarReturnValue, nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/compatibility" + 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, "{"+"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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListDatabasesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + region string +} + +func (r ApiListDatabasesRequest) Execute() (*ListDatabasesResponse, *http.Response, error) { + return r.ApiService.ListDatabasesExecute(r) +} + +/* +ListDatabases Get list of databases + +Get list of all databases in the 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 region The region which should be addressed + @return ApiListDatabasesRequest +*/ +func (a *DefaultAPIService) ListDatabases(ctx context.Context, projectId string, instanceId string, region string) ApiListDatabasesRequest { + return ApiListDatabasesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + region: region, + } +} + +// Execute executes the request +// +// @return ListDatabasesResponse +func (a *DefaultAPIService) ListDatabasesExecute(r ApiListDatabasesRequest) (*ListDatabasesResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListDatabasesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListDatabases") + if err != nil { + return localVarReturnValue, nil, &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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListFlavorsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string +} + +func (r ApiListFlavorsRequest) Execute() (*ListFlavorsResponse, *http.Response, 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, *http.Response, 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, nil, &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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListInstancesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string +} + +func (r ApiListInstancesRequest) Execute() (*ListInstancesResponse, *http.Response, 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, *http.Response, 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, nil, &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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListMetricsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + region 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() (*ListMetricsResponse, *http.Response, 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 instanceId The UUID of the instance. + @param region The region which should be addressed + @param metric The name of the metric. Valid metrics are 'cpu', 'memory', 'data-disk-size', 'data-disk-use','log-disk-size', 'log-disk-use', 'life-expectancy' and 'connections'. + @return ApiListMetricsRequest +*/ +func (a *DefaultAPIService) ListMetrics(ctx context.Context, projectId string, instanceId string, region string, metric string) ApiListMetricsRequest { + return ApiListMetricsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + region: region, + metric: metric, + } +} + +// Execute executes the request +// +// @return ListMetricsResponse +func (a *DefaultAPIService) ListMetricsExecute(r ApiListMetricsRequest) (*ListMetricsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListMetricsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListMetrics") + if err != nil { + return localVarReturnValue, nil, &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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -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, nil, 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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListRestoreJobsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + region string +} + +func (r ApiListRestoreJobsRequest) Execute() (*ListRestoreJobsResponse, *http.Response, error) { + return r.ApiService.ListRestoreJobsExecute(r) +} + +/* +ListRestoreJobs List current running restore jobs + +List all currently running restore jobs 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 + @param region The region which should be addressed + @return ApiListRestoreJobsRequest +*/ +func (a *DefaultAPIService) ListRestoreJobs(ctx context.Context, projectId string, instanceId string, region string) ApiListRestoreJobsRequest { + return ApiListRestoreJobsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + region: region, + } +} + +// Execute executes the request +// +// @return ListRestoreJobsResponse +func (a *DefaultAPIService) ListRestoreJobsExecute(r ApiListRestoreJobsRequest) (*ListRestoreJobsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListRestoreJobsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListRestoreJobs") + if err != nil { + return localVarReturnValue, nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/restores" + 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, "{"+"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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListRolesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + region string +} + +func (r ApiListRolesRequest) Execute() (*ListRolesResponse, *http.Response, error) { + return r.ApiService.ListRolesExecute(r) +} + +/* +ListRoles List Roles + +List available roles for an instance that can be assigned to a user + + @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 region The region which should be addressed + @return ApiListRolesRequest +*/ +func (a *DefaultAPIService) ListRoles(ctx context.Context, projectId string, instanceId string, region string) ApiListRolesRequest { + return ApiListRolesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + region: region, + } +} + +// Execute executes the request +// +// @return ListRolesResponse +func (a *DefaultAPIService) ListRolesExecute(r ApiListRolesRequest) (*ListRolesResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListRolesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListRoles") + if err != nil { + return localVarReturnValue, nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/roles" + 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, "{"+"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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListStoragesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + flavorId string + region string +} + +func (r ApiListStoragesRequest) Execute() (*ListStoragesResponse, *http.Response, 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 + @param region The region which should be addressed + @return ApiListStoragesRequest +*/ +func (a *DefaultAPIService) ListStorages(ctx context.Context, projectId string, flavorId string, region string) ApiListStoragesRequest { + return ApiListStoragesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + flavorId: flavorId, + region: region, + } +} + +// Execute executes the request +// +// @return ListStoragesResponse +func (a *DefaultAPIService) ListStoragesExecute(r ApiListStoragesRequest) (*ListStoragesResponse, *http.Response, 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, nil, &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, "{"+"flavorId"+"}", url.PathEscape(parameterValueToString(r.flavorId, "flavorId")), -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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListUsersRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + region string +} + +func (r ApiListUsersRequest) Execute() (*ListUsersResponse, *http.Response, 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 + @param region The region which should be addressed + @return ApiListUsersRequest +*/ +func (a *DefaultAPIService) ListUsers(ctx context.Context, projectId string, instanceId string, region string) ApiListUsersRequest { + return ApiListUsersRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + region: region, + } +} + +// Execute executes the request +// +// @return ListUsersResponse +func (a *DefaultAPIService) ListUsersExecute(r ApiListUsersRequest) (*ListUsersResponse, *http.Response, 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, nil, &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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, 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, *http.Response, error) { + return r.ApiService.ListVersionsExecute(r) +} + +/* +ListVersions Get Versions + +Get available versions for mssql 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, *http.Response, 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, nil, &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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPartialUpdateInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + region string + partialUpdateInstancePayload *PartialUpdateInstancePayload +} + +// Body +func (r ApiPartialUpdateInstanceRequest) PartialUpdateInstancePayload(partialUpdateInstancePayload PartialUpdateInstancePayload) ApiPartialUpdateInstanceRequest { + r.partialUpdateInstancePayload = &partialUpdateInstancePayload + return r +} + +func (r ApiPartialUpdateInstanceRequest) Execute() (*UpdateInstanceResponse, *http.Response, error) { + return r.ApiService.PartialUpdateInstanceExecute(r) +} + +/* +PartialUpdateInstance Update Instance + +Update available instance of a mssql database. + +**Please note that any changes applied via PUT or PATCH requests will initiate a reboot of the SQL Server Flex 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 region The region which should be addressed + @return ApiPartialUpdateInstanceRequest +*/ +func (a *DefaultAPIService) PartialUpdateInstance(ctx context.Context, projectId string, instanceId string, region string) ApiPartialUpdateInstanceRequest { + return ApiPartialUpdateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + region: region, + } +} + +// Execute executes the request +// +// @return UpdateInstanceResponse +func (a *DefaultAPIService) PartialUpdateInstanceExecute(r ApiPartialUpdateInstanceRequest) (*UpdateInstanceResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UpdateInstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PartialUpdateInstance") + if err != nil { + return localVarReturnValue, nil, &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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -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.partialUpdateInstancePayload == nil { + return localVarReturnValue, nil, 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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiResetUserRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + userId string + region string +} + +func (r ApiResetUserRequest) Execute() (*ResetUserResponse, *http.Response, error) { + return r.ApiService.ResetUserExecute(r) +} + +/* +ResetUser Reset User + +Reset user password for a mssql 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 + @param region The region which should be addressed + @return ApiResetUserRequest +*/ +func (a *DefaultAPIService) ResetUser(ctx context.Context, projectId string, instanceId string, userId string, region string) ApiResetUserRequest { + return ApiResetUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + userId: userId, + region: region, + } +} + +// Execute executes the request +// +// @return ResetUserResponse +func (a *DefaultAPIService) ResetUserExecute(r ApiResetUserRequest) (*ResetUserResponse, *http.Response, 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, nil, &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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTerminateProjectRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string +} + +func (r ApiTerminateProjectRequest) Execute() (*http.Response, error) { + return r.ApiService.TerminateProjectExecute(r) +} + +/* +TerminateProject Terminate the Project + +Termination is the deletion of a whole project which causes the deletion of all instances for this project. Only System with permission system.databases-project.remove is able to call this resource + + @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 ApiTerminateProjectRequest +*/ +func (a *DefaultAPIService) TerminateProject(ctx context.Context, projectId string, region string) ApiTerminateProjectRequest { + return ApiTerminateProjectRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +func (a *DefaultAPIService) TerminateProjectExecute(r ApiTerminateProjectRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.TerminateProject") + if err != nil { + return nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}" + 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 nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiTriggerDatabaseBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + databaseName string + region string +} + +func (r ApiTriggerDatabaseBackupRequest) Execute() (*http.Response, error) { + return r.ApiService.TriggerDatabaseBackupExecute(r) +} + +/* +TriggerDatabaseBackup Trigger backup for a specific Database + +Trigger backup for a specific Database + + @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 databaseName Database Name + @param region The region which should be addressed + @return ApiTriggerDatabaseBackupRequest +*/ +func (a *DefaultAPIService) TriggerDatabaseBackup(ctx context.Context, projectId string, instanceId string, databaseName string, region string) ApiTriggerDatabaseBackupRequest { + return ApiTriggerDatabaseBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + databaseName: databaseName, + region: region, + } +} + +// Execute executes the request +func (a *DefaultAPIService) TriggerDatabaseBackupExecute(r ApiTriggerDatabaseBackupRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.TriggerDatabaseBackup") + if err != nil { + return nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/backups/databases/{databaseName}" + 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, "{"+"databaseName"+"}", url.PathEscape(parameterValueToString(r.databaseName, "databaseName")), -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 nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiTriggerDatabaseRestoreRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + databaseName string + region string + triggerDatabaseRestorePayload *TriggerDatabaseRestorePayload +} + +// Body +func (r ApiTriggerDatabaseRestoreRequest) TriggerDatabaseRestorePayload(triggerDatabaseRestorePayload TriggerDatabaseRestorePayload) ApiTriggerDatabaseRestoreRequest { + r.triggerDatabaseRestorePayload = &triggerDatabaseRestorePayload + return r +} + +func (r ApiTriggerDatabaseRestoreRequest) Execute() (*http.Response, error) { + return r.ApiService.TriggerDatabaseRestoreExecute(r) +} + +/* +TriggerDatabaseRestore Trigger restore for a specific Database + +Trigger restore for a specific Database + + @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 databaseName Database Name + @param region The region which should be addressed + @return ApiTriggerDatabaseRestoreRequest +*/ +func (a *DefaultAPIService) TriggerDatabaseRestore(ctx context.Context, projectId string, instanceId string, databaseName string, region string) ApiTriggerDatabaseRestoreRequest { + return ApiTriggerDatabaseRestoreRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + databaseName: databaseName, + region: region, + } +} + +// Execute executes the request +func (a *DefaultAPIService) TriggerDatabaseRestoreExecute(r ApiTriggerDatabaseRestoreRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.TriggerDatabaseRestore") + if err != nil { + return nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/backups/databases/{databaseName}/restores" + 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, "{"+"databaseName"+"}", url.PathEscape(parameterValueToString(r.databaseName, "databaseName")), -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.triggerDatabaseRestorePayload == nil { + return nil, reportError("triggerDatabaseRestorePayload 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.triggerDatabaseRestorePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiUpdateInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + region string + updateInstancePayload *UpdateInstancePayload +} + +// Body +func (r ApiUpdateInstanceRequest) UpdateInstancePayload(updateInstancePayload UpdateInstancePayload) ApiUpdateInstanceRequest { + r.updateInstancePayload = &updateInstancePayload + return r +} + +func (r ApiUpdateInstanceRequest) Execute() (*UpdateInstanceResponse, *http.Response, error) { + return r.ApiService.UpdateInstanceExecute(r) +} + +/* +UpdateInstance Update Instance + +Update available instance of a mssql database. + +**Please note that any changes applied via PUT or PATCH requests will initiate a reboot of the SQL Server Flex 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 region The region which should be addressed + @return ApiUpdateInstanceRequest +*/ +func (a *DefaultAPIService) UpdateInstance(ctx context.Context, projectId string, instanceId string, region string) ApiUpdateInstanceRequest { + return ApiUpdateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + region: region, + } +} + +// Execute executes the request +// +// @return UpdateInstanceResponse +func (a *DefaultAPIService) UpdateInstanceExecute(r ApiUpdateInstanceRequest) (*UpdateInstanceResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UpdateInstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateInstance") + if err != nil { + return localVarReturnValue, nil, &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, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -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.updateInstancePayload == nil { + return localVarReturnValue, nil, 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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v InstanceError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/services/sqlserverflex/v2api/api_default_mock.go b/services/sqlserverflex/v2api/api_default_mock.go new file mode 100644 index 000000000..bb56e6a44 --- /dev/null +++ b/services/sqlserverflex/v2api/api_default_mock.go @@ -0,0 +1,639 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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" + "net/http" +) + +// 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 { + // CreateDatabaseExecuteMock can be populated to implement the behavior of the CreateDatabaseExecute function of this mock + CreateDatabaseExecuteMock *func(r ApiCreateDatabaseRequest) (*CreateDatabaseResponse, *http.Response, error) + // CreateInstanceExecuteMock can be populated to implement the behavior of the CreateInstanceExecute function of this mock + CreateInstanceExecuteMock *func(r ApiCreateInstanceRequest) (*CreateInstanceResponse, *http.Response, error) + // CreateUserExecuteMock can be populated to implement the behavior of the CreateUserExecute function of this mock + CreateUserExecuteMock *func(r ApiCreateUserRequest) (*CreateUserResponse, *http.Response, error) + // DeleteDatabaseExecuteMock can be populated to implement the behavior of the DeleteDatabaseExecute function of this mock + DeleteDatabaseExecuteMock *func(r ApiDeleteDatabaseRequest) (*http.Response, error) + // DeleteInstanceExecuteMock can be populated to implement the behavior of the DeleteInstanceExecute function of this mock + DeleteInstanceExecuteMock *func(r ApiDeleteInstanceRequest) (*http.Response, error) + // DeleteUserExecuteMock can be populated to implement the behavior of the DeleteUserExecute function of this mock + DeleteUserExecuteMock *func(r ApiDeleteUserRequest) (*http.Response, error) + // GetBackupExecuteMock can be populated to implement the behavior of the GetBackupExecute function of this mock + GetBackupExecuteMock *func(r ApiGetBackupRequest) (*GetBackupResponse, *http.Response, error) + // GetDatabaseExecuteMock can be populated to implement the behavior of the GetDatabaseExecute function of this mock + GetDatabaseExecuteMock *func(r ApiGetDatabaseRequest) (*GetDatabaseResponse, *http.Response, error) + // GetInstanceExecuteMock can be populated to implement the behavior of the GetInstanceExecute function of this mock + GetInstanceExecuteMock *func(r ApiGetInstanceRequest) (*GetInstanceResponse, *http.Response, error) + // GetUserExecuteMock can be populated to implement the behavior of the GetUserExecute function of this mock + GetUserExecuteMock *func(r ApiGetUserRequest) (*GetUserResponse, *http.Response, error) + // ListBackupsExecuteMock can be populated to implement the behavior of the ListBackupsExecute function of this mock + ListBackupsExecuteMock *func(r ApiListBackupsRequest) (*ListBackupsResponse, *http.Response, error) + // ListCollationsExecuteMock can be populated to implement the behavior of the ListCollationsExecute function of this mock + ListCollationsExecuteMock *func(r ApiListCollationsRequest) (*ListCollationsResponse, *http.Response, error) + // ListCompatibilityExecuteMock can be populated to implement the behavior of the ListCompatibilityExecute function of this mock + ListCompatibilityExecuteMock *func(r ApiListCompatibilityRequest) (*ListCompatibilityResponse, *http.Response, error) + // ListDatabasesExecuteMock can be populated to implement the behavior of the ListDatabasesExecute function of this mock + ListDatabasesExecuteMock *func(r ApiListDatabasesRequest) (*ListDatabasesResponse, *http.Response, error) + // ListFlavorsExecuteMock can be populated to implement the behavior of the ListFlavorsExecute function of this mock + ListFlavorsExecuteMock *func(r ApiListFlavorsRequest) (*ListFlavorsResponse, *http.Response, error) + // ListInstancesExecuteMock can be populated to implement the behavior of the ListInstancesExecute function of this mock + ListInstancesExecuteMock *func(r ApiListInstancesRequest) (*ListInstancesResponse, *http.Response, error) + // ListMetricsExecuteMock can be populated to implement the behavior of the ListMetricsExecute function of this mock + ListMetricsExecuteMock *func(r ApiListMetricsRequest) (*ListMetricsResponse, *http.Response, error) + // ListRestoreJobsExecuteMock can be populated to implement the behavior of the ListRestoreJobsExecute function of this mock + ListRestoreJobsExecuteMock *func(r ApiListRestoreJobsRequest) (*ListRestoreJobsResponse, *http.Response, error) + // ListRolesExecuteMock can be populated to implement the behavior of the ListRolesExecute function of this mock + ListRolesExecuteMock *func(r ApiListRolesRequest) (*ListRolesResponse, *http.Response, error) + // ListStoragesExecuteMock can be populated to implement the behavior of the ListStoragesExecute function of this mock + ListStoragesExecuteMock *func(r ApiListStoragesRequest) (*ListStoragesResponse, *http.Response, error) + // ListUsersExecuteMock can be populated to implement the behavior of the ListUsersExecute function of this mock + ListUsersExecuteMock *func(r ApiListUsersRequest) (*ListUsersResponse, *http.Response, error) + // ListVersionsExecuteMock can be populated to implement the behavior of the ListVersionsExecute function of this mock + ListVersionsExecuteMock *func(r ApiListVersionsRequest) (*ListVersionsResponse, *http.Response, error) + // PartialUpdateInstanceExecuteMock can be populated to implement the behavior of the PartialUpdateInstanceExecute function of this mock + PartialUpdateInstanceExecuteMock *func(r ApiPartialUpdateInstanceRequest) (*UpdateInstanceResponse, *http.Response, error) + // ResetUserExecuteMock can be populated to implement the behavior of the ResetUserExecute function of this mock + ResetUserExecuteMock *func(r ApiResetUserRequest) (*ResetUserResponse, *http.Response, error) + // TerminateProjectExecuteMock can be populated to implement the behavior of the TerminateProjectExecute function of this mock + TerminateProjectExecuteMock *func(r ApiTerminateProjectRequest) (*http.Response, error) + // TriggerDatabaseBackupExecuteMock can be populated to implement the behavior of the TriggerDatabaseBackupExecute function of this mock + TriggerDatabaseBackupExecuteMock *func(r ApiTriggerDatabaseBackupRequest) (*http.Response, error) + // TriggerDatabaseRestoreExecuteMock can be populated to implement the behavior of the TriggerDatabaseRestoreExecute function of this mock + TriggerDatabaseRestoreExecuteMock *func(r ApiTriggerDatabaseRestoreRequest) (*http.Response, error) + // UpdateInstanceExecuteMock can be populated to implement the behavior of the UpdateInstanceExecute function of this mock + UpdateInstanceExecuteMock *func(r ApiUpdateInstanceRequest) (*UpdateInstanceResponse, *http.Response, error) +} + +func (a DefaultAPIServiceMock) CreateDatabase(ctx context.Context, projectId string, instanceId string, region string) ApiCreateDatabaseRequest { + return ApiCreateDatabaseRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + region: region, + } +} + +// 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) (*CreateDatabaseResponse, *http.Response, error) { + if a.CreateDatabaseExecuteMock == nil { + var localVarReturnValue *CreateDatabaseResponse + return localVarReturnValue, &http.Response{}, 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, *http.Response, error) { + if a.CreateInstanceExecuteMock == nil { + var localVarReturnValue *CreateInstanceResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.CreateInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateUser(ctx context.Context, projectId string, instanceId string, region string) ApiCreateUserRequest { + return ApiCreateUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + region: region, + } +} + +// 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, *http.Response, error) { + if a.CreateUserExecuteMock == nil { + var localVarReturnValue *CreateUserResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.CreateUserExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteDatabase(ctx context.Context, projectId string, instanceId string, databaseName string, region string) ApiDeleteDatabaseRequest { + return ApiDeleteDatabaseRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + databaseName: databaseName, + region: region, + } +} + +// 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) (*http.Response, error) { + if a.DeleteDatabaseExecuteMock == nil { + return &http.Response{}, nil + } + + return (*a.DeleteDatabaseExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteInstance(ctx context.Context, projectId string, instanceId string, region string) ApiDeleteInstanceRequest { + return ApiDeleteInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + region: region, + } +} + +// 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) (*http.Response, error) { + if a.DeleteInstanceExecuteMock == nil { + return &http.Response{}, nil + } + + return (*a.DeleteInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteUser(ctx context.Context, projectId string, instanceId string, userId string, region string) ApiDeleteUserRequest { + return ApiDeleteUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + userId: userId, + region: region, + } +} + +// 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) (*http.Response, error) { + if a.DeleteUserExecuteMock == nil { + return &http.Response{}, nil + } + + return (*a.DeleteUserExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetBackup(ctx context.Context, projectId string, instanceId string, backupId string, region string) ApiGetBackupRequest { + return ApiGetBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + backupId: backupId, + region: region, + } +} + +// 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, *http.Response, error) { + if a.GetBackupExecuteMock == nil { + var localVarReturnValue *GetBackupResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.GetBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetDatabase(ctx context.Context, projectId string, instanceId string, databaseName string, region string) ApiGetDatabaseRequest { + return ApiGetDatabaseRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + databaseName: databaseName, + region: region, + } +} + +// GetDatabaseExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetDatabaseExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetDatabaseExecute(r ApiGetDatabaseRequest) (*GetDatabaseResponse, *http.Response, error) { + if a.GetDatabaseExecuteMock == nil { + var localVarReturnValue *GetDatabaseResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.GetDatabaseExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetInstance(ctx context.Context, projectId string, instanceId string, region string) ApiGetInstanceRequest { + return ApiGetInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + region: region, + } +} + +// 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) (*GetInstanceResponse, *http.Response, error) { + if a.GetInstanceExecuteMock == nil { + var localVarReturnValue *GetInstanceResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.GetInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetUser(ctx context.Context, projectId string, instanceId string, userId string, region string) ApiGetUserRequest { + return ApiGetUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + userId: userId, + region: region, + } +} + +// 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, *http.Response, error) { + if a.GetUserExecuteMock == nil { + var localVarReturnValue *GetUserResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.GetUserExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListBackups(ctx context.Context, projectId string, instanceId string, region string) ApiListBackupsRequest { + return ApiListBackupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + region: region, + } +} + +// ListBackupsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListBackupsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupsResponse, *http.Response, error) { + if a.ListBackupsExecuteMock == nil { + var localVarReturnValue *ListBackupsResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.ListBackupsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListCollations(ctx context.Context, projectId string, instanceId string, region string) ApiListCollationsRequest { + return ApiListCollationsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + region: region, + } +} + +// ListCollationsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListCollationsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListCollationsExecute(r ApiListCollationsRequest) (*ListCollationsResponse, *http.Response, error) { + if a.ListCollationsExecuteMock == nil { + var localVarReturnValue *ListCollationsResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.ListCollationsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListCompatibility(ctx context.Context, projectId string, instanceId string, region string) ApiListCompatibilityRequest { + return ApiListCompatibilityRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + region: region, + } +} + +// ListCompatibilityExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListCompatibilityExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListCompatibilityExecute(r ApiListCompatibilityRequest) (*ListCompatibilityResponse, *http.Response, error) { + if a.ListCompatibilityExecuteMock == nil { + var localVarReturnValue *ListCompatibilityResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.ListCompatibilityExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListDatabases(ctx context.Context, projectId string, instanceId string, region string) ApiListDatabasesRequest { + return ApiListDatabasesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + region: region, + } +} + +// 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) (*ListDatabasesResponse, *http.Response, error) { + if a.ListDatabasesExecuteMock == nil { + var localVarReturnValue *ListDatabasesResponse + return localVarReturnValue, &http.Response{}, 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, *http.Response, error) { + if a.ListFlavorsExecuteMock == nil { + var localVarReturnValue *ListFlavorsResponse + return localVarReturnValue, &http.Response{}, 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, *http.Response, error) { + if a.ListInstancesExecuteMock == nil { + var localVarReturnValue *ListInstancesResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.ListInstancesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListMetrics(ctx context.Context, projectId string, instanceId string, region string, metric string) ApiListMetricsRequest { + return ApiListMetricsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + region: region, + 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) (*ListMetricsResponse, *http.Response, error) { + if a.ListMetricsExecuteMock == nil { + var localVarReturnValue *ListMetricsResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.ListMetricsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListRestoreJobs(ctx context.Context, projectId string, instanceId string, region string) ApiListRestoreJobsRequest { + return ApiListRestoreJobsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + region: region, + } +} + +// ListRestoreJobsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListRestoreJobsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListRestoreJobsExecute(r ApiListRestoreJobsRequest) (*ListRestoreJobsResponse, *http.Response, error) { + if a.ListRestoreJobsExecuteMock == nil { + var localVarReturnValue *ListRestoreJobsResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.ListRestoreJobsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListRoles(ctx context.Context, projectId string, instanceId string, region string) ApiListRolesRequest { + return ApiListRolesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + region: region, + } +} + +// ListRolesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListRolesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListRolesExecute(r ApiListRolesRequest) (*ListRolesResponse, *http.Response, error) { + if a.ListRolesExecuteMock == nil { + var localVarReturnValue *ListRolesResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.ListRolesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListStorages(ctx context.Context, projectId string, flavorId string, region string) ApiListStoragesRequest { + return ApiListStoragesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + flavorId: flavorId, + region: region, + } +} + +// 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, *http.Response, error) { + if a.ListStoragesExecuteMock == nil { + var localVarReturnValue *ListStoragesResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.ListStoragesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListUsers(ctx context.Context, projectId string, instanceId string, region string) ApiListUsersRequest { + return ApiListUsersRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + region: region, + } +} + +// 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, *http.Response, error) { + if a.ListUsersExecuteMock == nil { + var localVarReturnValue *ListUsersResponse + return localVarReturnValue, &http.Response{}, 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, *http.Response, error) { + if a.ListVersionsExecuteMock == nil { + var localVarReturnValue *ListVersionsResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.ListVersionsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) PartialUpdateInstance(ctx context.Context, projectId string, instanceId string, region string) ApiPartialUpdateInstanceRequest { + return ApiPartialUpdateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + region: region, + } +} + +// 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) (*UpdateInstanceResponse, *http.Response, error) { + if a.PartialUpdateInstanceExecuteMock == nil { + var localVarReturnValue *UpdateInstanceResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.PartialUpdateInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ResetUser(ctx context.Context, projectId string, instanceId string, userId string, region string) ApiResetUserRequest { + return ApiResetUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + userId: userId, + region: region, + } +} + +// 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, *http.Response, error) { + if a.ResetUserExecuteMock == nil { + var localVarReturnValue *ResetUserResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.ResetUserExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) TerminateProject(ctx context.Context, projectId string, region string) ApiTerminateProjectRequest { + return ApiTerminateProjectRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// TerminateProjectExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the TerminateProjectExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) TerminateProjectExecute(r ApiTerminateProjectRequest) (*http.Response, error) { + if a.TerminateProjectExecuteMock == nil { + return &http.Response{}, nil + } + + return (*a.TerminateProjectExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) TriggerDatabaseBackup(ctx context.Context, projectId string, instanceId string, databaseName string, region string) ApiTriggerDatabaseBackupRequest { + return ApiTriggerDatabaseBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + databaseName: databaseName, + region: region, + } +} + +// TriggerDatabaseBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the TriggerDatabaseBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) TriggerDatabaseBackupExecute(r ApiTriggerDatabaseBackupRequest) (*http.Response, error) { + if a.TriggerDatabaseBackupExecuteMock == nil { + return &http.Response{}, nil + } + + return (*a.TriggerDatabaseBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) TriggerDatabaseRestore(ctx context.Context, projectId string, instanceId string, databaseName string, region string) ApiTriggerDatabaseRestoreRequest { + return ApiTriggerDatabaseRestoreRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + databaseName: databaseName, + region: region, + } +} + +// TriggerDatabaseRestoreExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the TriggerDatabaseRestoreExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) TriggerDatabaseRestoreExecute(r ApiTriggerDatabaseRestoreRequest) (*http.Response, error) { + if a.TriggerDatabaseRestoreExecuteMock == nil { + return &http.Response{}, nil + } + + return (*a.TriggerDatabaseRestoreExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateInstance(ctx context.Context, projectId string, instanceId string, region string) ApiUpdateInstanceRequest { + return ApiUpdateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + region: region, + } +} + +// 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) (*UpdateInstanceResponse, *http.Response, error) { + if a.UpdateInstanceExecuteMock == nil { + var localVarReturnValue *UpdateInstanceResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.UpdateInstanceExecuteMock)(r) +} diff --git a/services/sqlserverflex/v2api/client.go b/services/sqlserverflex/v2api/client.go new file mode 100644 index 000000000..7d079d850 --- /dev/null +++ b/services/sqlserverflex/v2api/client.go @@ -0,0 +1,659 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 MSSQL Service 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/sqlserverflex/v2api/configuration.go b/services/sqlserverflex/v2api/configuration.go new file mode 100644 index 000000000..17679dd97 --- /dev/null +++ b/services/sqlserverflex/v2api/configuration.go @@ -0,0 +1,38 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex", + Debug: false, + Servers: config.ServerConfigurations{ + { + URL: "https://mssql-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/sqlserverflex/v2api/model_acl.go b/services/sqlserverflex/v2api/model_acl.go new file mode 100644 index 000000000..72ba0c8cf --- /dev/null +++ b/services/sqlserverflex/v2api/model_acl.go @@ -0,0 +1,125 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v2api/model_backup.go b/services/sqlserverflex/v2api/model_backup.go new file mode 100644 index 000000000..05a696f04 --- /dev/null +++ b/services/sqlserverflex/v2api/model_backup.go @@ -0,0 +1,377 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v2api/model_backup_list_backups_response_grouped.go b/services/sqlserverflex/v2api/model_backup_list_backups_response_grouped.go new file mode 100644 index 000000000..189507fcf --- /dev/null +++ b/services/sqlserverflex/v2api/model_backup_list_backups_response_grouped.go @@ -0,0 +1,161 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 BackupListBackupsResponseGrouped type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BackupListBackupsResponseGrouped{} + +// BackupListBackupsResponseGrouped struct for BackupListBackupsResponseGrouped +type BackupListBackupsResponseGrouped struct { + Backups []Backup `json:"backups,omitempty"` + Name *string `json:"name,omitempty"` +} + +// NewBackupListBackupsResponseGrouped instantiates a new BackupListBackupsResponseGrouped object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBackupListBackupsResponseGrouped() *BackupListBackupsResponseGrouped { + this := BackupListBackupsResponseGrouped{} + return &this +} + +// NewBackupListBackupsResponseGroupedWithDefaults instantiates a new BackupListBackupsResponseGrouped object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBackupListBackupsResponseGroupedWithDefaults() *BackupListBackupsResponseGrouped { + this := BackupListBackupsResponseGrouped{} + return &this +} + +// GetBackups returns the Backups field value if set, zero value otherwise. +func (o *BackupListBackupsResponseGrouped) GetBackups() []Backup { + if o == nil || IsNil(o.Backups) { + var ret []Backup + return ret + } + return o.Backups +} + +// GetBackupsOk returns a tuple with the Backups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BackupListBackupsResponseGrouped) GetBackupsOk() ([]Backup, bool) { + if o == nil || IsNil(o.Backups) { + return nil, false + } + return o.Backups, true +} + +// HasBackups returns a boolean if a field has been set. +func (o *BackupListBackupsResponseGrouped) HasBackups() bool { + if o != nil && !IsNil(o.Backups) { + return true + } + + return false +} + +// SetBackups gets a reference to the given []Backup and assigns it to the Backups field. +func (o *BackupListBackupsResponseGrouped) SetBackups(v []Backup) { + o.Backups = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *BackupListBackupsResponseGrouped) 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 *BackupListBackupsResponseGrouped) 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 *BackupListBackupsResponseGrouped) 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 *BackupListBackupsResponseGrouped) SetName(v string) { + o.Name = &v +} + +func (o BackupListBackupsResponseGrouped) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BackupListBackupsResponseGrouped) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Backups) { + toSerialize["backups"] = o.Backups + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + return toSerialize, nil +} + +type NullableBackupListBackupsResponseGrouped struct { + value *BackupListBackupsResponseGrouped + isSet bool +} + +func (v NullableBackupListBackupsResponseGrouped) Get() *BackupListBackupsResponseGrouped { + return v.value +} + +func (v *NullableBackupListBackupsResponseGrouped) Set(val *BackupListBackupsResponseGrouped) { + v.value = val + v.isSet = true +} + +func (v NullableBackupListBackupsResponseGrouped) IsSet() bool { + return v.isSet +} + +func (v *NullableBackupListBackupsResponseGrouped) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackupListBackupsResponseGrouped(val *BackupListBackupsResponseGrouped) *NullableBackupListBackupsResponseGrouped { + return &NullableBackupListBackupsResponseGrouped{value: val, isSet: true} +} + +func (v NullableBackupListBackupsResponseGrouped) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackupListBackupsResponseGrouped) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_create_database_payload.go b/services/sqlserverflex/v2api/model_create_database_payload.go new file mode 100644 index 000000000..229b0bcf4 --- /dev/null +++ b/services/sqlserverflex/v2api/model_create_database_payload.go @@ -0,0 +1,185 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 CreateDatabasePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateDatabasePayload{} + +// CreateDatabasePayload struct for CreateDatabasePayload +type CreateDatabasePayload struct { + Name string `json:"name"` + Options DatabaseDocumentationCreateDatabaseRequestOptions `json:"options"` +} + +type _CreateDatabasePayload CreateDatabasePayload + +// 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(name string, options DatabaseDocumentationCreateDatabaseRequestOptions) *CreateDatabasePayload { + this := CreateDatabasePayload{} + this.Name = name + this.Options = options + 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 +func (o *CreateDatabasePayload) 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 *CreateDatabasePayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateDatabasePayload) SetName(v string) { + o.Name = v +} + +// GetOptions returns the Options field value +func (o *CreateDatabasePayload) GetOptions() DatabaseDocumentationCreateDatabaseRequestOptions { + if o == nil { + var ret DatabaseDocumentationCreateDatabaseRequestOptions + 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 *CreateDatabasePayload) GetOptionsOk() (*DatabaseDocumentationCreateDatabaseRequestOptions, bool) { + if o == nil { + return nil, false + } + return &o.Options, true +} + +// SetOptions sets field value +func (o *CreateDatabasePayload) SetOptions(v DatabaseDocumentationCreateDatabaseRequestOptions) { + 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{}{} + toSerialize["name"] = o.Name + toSerialize["options"] = o.Options + return toSerialize, nil +} + +func (o *CreateDatabasePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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", + "options", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateDatabasePayload := _CreateDatabasePayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateDatabasePayload) + + if err != nil { + return err + } + + *o = CreateDatabasePayload(varCreateDatabasePayload) + + return err +} + +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/sqlserverflex/v2api/model_create_database_response.go b/services/sqlserverflex/v2api/model_create_database_response.go new file mode 100644 index 000000000..7180fadc1 --- /dev/null +++ b/services/sqlserverflex/v2api/model_create_database_response.go @@ -0,0 +1,125 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 CreateDatabaseResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateDatabaseResponse{} + +// CreateDatabaseResponse struct for CreateDatabaseResponse +type CreateDatabaseResponse struct { + Id *string `json:"id,omitempty"` +} + +// 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() *CreateDatabaseResponse { + this := CreateDatabaseResponse{} + 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 if set, zero value otherwise. +func (o *CreateDatabaseResponse) 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 *CreateDatabaseResponse) 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 *CreateDatabaseResponse) 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 *CreateDatabaseResponse) SetId(v string) { + 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{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + return toSerialize, nil +} + +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/sqlserverflex/v2api/model_create_instance_payload.go b/services/sqlserverflex/v2api/model_create_instance_payload.go new file mode 100644 index 000000000..b3f327b4f --- /dev/null +++ b/services/sqlserverflex/v2api/model_create_instance_payload.go @@ -0,0 +1,413 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 is the Access Control List defining the IP ranges allowed to connect to the database + Acl *InstanceDocumentationACL `json:"acl,omitempty"` + // Cronjob for the daily full backup if not provided a job will generated between 00:00 and 04:59 + BackupSchedule *string `json:"backupSchedule,omitempty"` + // Id of the selected flavor + FlavorId string `json:"flavorId"` + // Labels for the instance + Labels map[string]interface{} `json:"labels,omitempty"` + // Name of the instance + Name string `json:"name"` + // Database instance specific options are requested via this field + Options *InstanceDocumentationOptions `json:"options,omitempty"` + // Storage for the instance + Storage *InstanceDocumentationStorage `json:"storage,omitempty"` + // Version of the MSSQL Server + Version *string `json:"version,omitempty"` +} + +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(flavorId string, name string) *CreateInstancePayload { + this := CreateInstancePayload{} + this.FlavorId = flavorId + this.Name = name + var version string = "2022" + 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{} + var version string = "2022" + this.Version = &version + return &this +} + +// GetAcl returns the Acl field value if set, zero value otherwise. +func (o *CreateInstancePayload) GetAcl() InstanceDocumentationACL { + if o == nil || IsNil(o.Acl) { + var ret InstanceDocumentationACL + 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 *CreateInstancePayload) GetAclOk() (*InstanceDocumentationACL, 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 *CreateInstancePayload) HasAcl() bool { + if o != nil && !IsNil(o.Acl) { + return true + } + + return false +} + +// SetAcl gets a reference to the given InstanceDocumentationACL and assigns it to the Acl field. +func (o *CreateInstancePayload) SetAcl(v InstanceDocumentationACL) { + o.Acl = &v +} + +// GetBackupSchedule returns the BackupSchedule field value if set, zero value otherwise. +func (o *CreateInstancePayload) 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 *CreateInstancePayload) 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 *CreateInstancePayload) 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 *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]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateInstancePayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateInstancePayload) SetLabels(v map[string]interface{}) { + 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 if set, zero value otherwise. +func (o *CreateInstancePayload) GetOptions() InstanceDocumentationOptions { + if o == nil || IsNil(o.Options) { + var ret InstanceDocumentationOptions + 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 *CreateInstancePayload) GetOptionsOk() (*InstanceDocumentationOptions, 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 *CreateInstancePayload) HasOptions() bool { + if o != nil && !IsNil(o.Options) { + return true + } + + return false +} + +// SetOptions gets a reference to the given InstanceDocumentationOptions and assigns it to the Options field. +func (o *CreateInstancePayload) SetOptions(v InstanceDocumentationOptions) { + o.Options = &v +} + +// GetStorage returns the Storage field value if set, zero value otherwise. +func (o *CreateInstancePayload) GetStorage() InstanceDocumentationStorage { + if o == nil || IsNil(o.Storage) { + var ret InstanceDocumentationStorage + 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 *CreateInstancePayload) GetStorageOk() (*InstanceDocumentationStorage, 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 *CreateInstancePayload) HasStorage() bool { + if o != nil && !IsNil(o.Storage) { + return true + } + + return false +} + +// SetStorage gets a reference to the given InstanceDocumentationStorage and assigns it to the Storage field. +func (o *CreateInstancePayload) SetStorage(v InstanceDocumentationStorage) { + o.Storage = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *CreateInstancePayload) 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 *CreateInstancePayload) 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 *CreateInstancePayload) 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 *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{}{} + if !IsNil(o.Acl) { + toSerialize["acl"] = o.Acl + } + if !IsNil(o.BackupSchedule) { + toSerialize["backupSchedule"] = o.BackupSchedule + } + toSerialize["flavorId"] = o.FlavorId + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + if !IsNil(o.Options) { + toSerialize["options"] = o.Options + } + if !IsNil(o.Storage) { + toSerialize["storage"] = o.Storage + } + if !IsNil(o.Version) { + 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{ + "flavorId", + "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) + } + } + + 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/sqlserverflex/v2api/model_create_instance_response.go b/services/sqlserverflex/v2api/model_create_instance_response.go new file mode 100644 index 000000000..e77fd504a --- /dev/null +++ b/services/sqlserverflex/v2api/model_create_instance_response.go @@ -0,0 +1,125 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v2api/model_create_user_payload.go b/services/sqlserverflex/v2api/model_create_user_payload.go new file mode 100644 index 000000000..3567483a9 --- /dev/null +++ b/services/sqlserverflex/v2api/model_create_user_payload.go @@ -0,0 +1,221 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 CreateUserPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateUserPayload{} + +// CreateUserPayload struct for CreateUserPayload +type CreateUserPayload struct { + DefaultDatabase *string `json:"default_database,omitempty"` + Roles []string `json:"roles"` + Username string `json:"username"` +} + +type _CreateUserPayload CreateUserPayload + +// 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(roles []string, username string) *CreateUserPayload { + this := CreateUserPayload{} + this.Roles = roles + this.Username = username + 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 +} + +// GetDefaultDatabase returns the DefaultDatabase field value if set, zero value otherwise. +func (o *CreateUserPayload) GetDefaultDatabase() string { + if o == nil || IsNil(o.DefaultDatabase) { + var ret string + return ret + } + return *o.DefaultDatabase +} + +// GetDefaultDatabaseOk returns a tuple with the DefaultDatabase field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateUserPayload) GetDefaultDatabaseOk() (*string, bool) { + if o == nil || IsNil(o.DefaultDatabase) { + return nil, false + } + return o.DefaultDatabase, true +} + +// HasDefaultDatabase returns a boolean if a field has been set. +func (o *CreateUserPayload) HasDefaultDatabase() bool { + if o != nil && !IsNil(o.DefaultDatabase) { + return true + } + + return false +} + +// SetDefaultDatabase gets a reference to the given string and assigns it to the DefaultDatabase field. +func (o *CreateUserPayload) SetDefaultDatabase(v string) { + o.DefaultDatabase = &v +} + +// GetRoles returns the Roles field value +func (o *CreateUserPayload) 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 *CreateUserPayload) GetRolesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Roles, true +} + +// SetRoles sets field value +func (o *CreateUserPayload) SetRoles(v []string) { + o.Roles = v +} + +// GetUsername returns the Username field value +func (o *CreateUserPayload) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *CreateUserPayload) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +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.DefaultDatabase) { + toSerialize["default_database"] = o.DefaultDatabase + } + toSerialize["roles"] = o.Roles + toSerialize["username"] = o.Username + return toSerialize, nil +} + +func (o *CreateUserPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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", + "username", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateUserPayload := _CreateUserPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateUserPayload) + + if err != nil { + return err + } + + *o = CreateUserPayload(varCreateUserPayload) + + return err +} + +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/sqlserverflex/v2api/model_create_user_response.go b/services/sqlserverflex/v2api/model_create_user_response.go new file mode 100644 index 000000000..6f531a99b --- /dev/null +++ b/services/sqlserverflex/v2api/model_create_user_response.go @@ -0,0 +1,125 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 *SingleUser `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() SingleUser { + if o == nil || IsNil(o.Item) { + var ret SingleUser + 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() (*SingleUser, 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 SingleUser and assigns it to the Item field. +func (o *CreateUserResponse) SetItem(v SingleUser) { + 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/sqlserverflex/v2api/model_data_point.go b/services/sqlserverflex/v2api/model_data_point.go new file mode 100644 index 000000000..2dbd84f99 --- /dev/null +++ b/services/sqlserverflex/v2api/model_data_point.go @@ -0,0 +1,161 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 DataPoint type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DataPoint{} + +// DataPoint struct for DataPoint +type DataPoint struct { + Timestamp *string `json:"timestamp,omitempty"` + Value *float32 `json:"value,omitempty"` +} + +// NewDataPoint instantiates a new DataPoint object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDataPoint() *DataPoint { + this := DataPoint{} + return &this +} + +// NewDataPointWithDefaults instantiates a new DataPoint object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDataPointWithDefaults() *DataPoint { + this := DataPoint{} + return &this +} + +// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +func (o *DataPoint) 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 *DataPoint) 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 *DataPoint) 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 *DataPoint) SetTimestamp(v string) { + o.Timestamp = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *DataPoint) 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 *DataPoint) 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 *DataPoint) 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 *DataPoint) SetValue(v float32) { + o.Value = &v +} + +func (o DataPoint) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DataPoint) 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 NullableDataPoint struct { + value *DataPoint + isSet bool +} + +func (v NullableDataPoint) Get() *DataPoint { + return v.value +} + +func (v *NullableDataPoint) Set(val *DataPoint) { + v.value = val + v.isSet = true +} + +func (v NullableDataPoint) IsSet() bool { + return v.isSet +} + +func (v *NullableDataPoint) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDataPoint(val *DataPoint) *NullableDataPoint { + return &NullableDataPoint{value: val, isSet: true} +} + +func (v NullableDataPoint) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDataPoint) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_database.go b/services/sqlserverflex/v2api/model_database.go new file mode 100644 index 000000000..79ded20d6 --- /dev/null +++ b/services/sqlserverflex/v2api/model_database.go @@ -0,0 +1,198 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 Database type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Database{} + +// Database struct for Database +type Database struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + // Database specific options + Options map[string]interface{} `json:"options,omitempty"` +} + +// NewDatabase instantiates a new Database object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDatabase() *Database { + this := Database{} + return &this +} + +// NewDatabaseWithDefaults instantiates a new Database object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDatabaseWithDefaults() *Database { + this := Database{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Database) 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 *Database) 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 *Database) 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 *Database) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Database) 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 *Database) 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 *Database) 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 *Database) SetName(v string) { + o.Name = &v +} + +// GetOptions returns the Options field value if set, zero value otherwise. +func (o *Database) 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 *Database) 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 *Database) 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 *Database) SetOptions(v map[string]interface{}) { + o.Options = v +} + +func (o Database) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Database) 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 NullableDatabase struct { + value *Database + isSet bool +} + +func (v NullableDatabase) Get() *Database { + return v.value +} + +func (v *NullableDatabase) Set(val *Database) { + v.value = val + v.isSet = true +} + +func (v NullableDatabase) IsSet() bool { + return v.isSet +} + +func (v *NullableDatabase) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDatabase(val *Database) *NullableDatabase { + return &NullableDatabase{value: val, isSet: true} +} + +func (v NullableDatabase) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDatabase) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_database_documentation_create_database_request_options.go b/services/sqlserverflex/v2api/model_database_documentation_create_database_request_options.go new file mode 100644 index 000000000..11d6160b6 --- /dev/null +++ b/services/sqlserverflex/v2api/model_database_documentation_create_database_request_options.go @@ -0,0 +1,232 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 DatabaseDocumentationCreateDatabaseRequestOptions type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DatabaseDocumentationCreateDatabaseRequestOptions{} + +// DatabaseDocumentationCreateDatabaseRequestOptions struct for DatabaseDocumentationCreateDatabaseRequestOptions +type DatabaseDocumentationCreateDatabaseRequestOptions struct { + // Collation of the database + Collation *string `json:"collation,omitempty"` + // CompatibilityLevel of the Database. + CompatibilityLevel *string `json:"compatibilityLevel,omitempty"` + // Name of the owner of the database. + Owner string `json:"owner"` +} + +type _DatabaseDocumentationCreateDatabaseRequestOptions DatabaseDocumentationCreateDatabaseRequestOptions + +// NewDatabaseDocumentationCreateDatabaseRequestOptions instantiates a new DatabaseDocumentationCreateDatabaseRequestOptions object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDatabaseDocumentationCreateDatabaseRequestOptions(owner string) *DatabaseDocumentationCreateDatabaseRequestOptions { + this := DatabaseDocumentationCreateDatabaseRequestOptions{} + this.Owner = owner + return &this +} + +// NewDatabaseDocumentationCreateDatabaseRequestOptionsWithDefaults instantiates a new DatabaseDocumentationCreateDatabaseRequestOptions object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDatabaseDocumentationCreateDatabaseRequestOptionsWithDefaults() *DatabaseDocumentationCreateDatabaseRequestOptions { + this := DatabaseDocumentationCreateDatabaseRequestOptions{} + return &this +} + +// GetCollation returns the Collation field value if set, zero value otherwise. +func (o *DatabaseDocumentationCreateDatabaseRequestOptions) GetCollation() string { + if o == nil || IsNil(o.Collation) { + var ret string + return ret + } + return *o.Collation +} + +// GetCollationOk returns a tuple with the Collation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DatabaseDocumentationCreateDatabaseRequestOptions) GetCollationOk() (*string, bool) { + if o == nil || IsNil(o.Collation) { + return nil, false + } + return o.Collation, true +} + +// HasCollation returns a boolean if a field has been set. +func (o *DatabaseDocumentationCreateDatabaseRequestOptions) HasCollation() bool { + if o != nil && !IsNil(o.Collation) { + return true + } + + return false +} + +// SetCollation gets a reference to the given string and assigns it to the Collation field. +func (o *DatabaseDocumentationCreateDatabaseRequestOptions) SetCollation(v string) { + o.Collation = &v +} + +// GetCompatibilityLevel returns the CompatibilityLevel field value if set, zero value otherwise. +func (o *DatabaseDocumentationCreateDatabaseRequestOptions) GetCompatibilityLevel() string { + if o == nil || IsNil(o.CompatibilityLevel) { + var ret string + return ret + } + return *o.CompatibilityLevel +} + +// GetCompatibilityLevelOk returns a tuple with the CompatibilityLevel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DatabaseDocumentationCreateDatabaseRequestOptions) GetCompatibilityLevelOk() (*string, bool) { + if o == nil || IsNil(o.CompatibilityLevel) { + return nil, false + } + return o.CompatibilityLevel, true +} + +// HasCompatibilityLevel returns a boolean if a field has been set. +func (o *DatabaseDocumentationCreateDatabaseRequestOptions) HasCompatibilityLevel() bool { + if o != nil && !IsNil(o.CompatibilityLevel) { + return true + } + + return false +} + +// SetCompatibilityLevel gets a reference to the given string and assigns it to the CompatibilityLevel field. +func (o *DatabaseDocumentationCreateDatabaseRequestOptions) SetCompatibilityLevel(v string) { + o.CompatibilityLevel = &v +} + +// GetOwner returns the Owner field value +func (o *DatabaseDocumentationCreateDatabaseRequestOptions) 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 *DatabaseDocumentationCreateDatabaseRequestOptions) GetOwnerOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Owner, true +} + +// SetOwner sets field value +func (o *DatabaseDocumentationCreateDatabaseRequestOptions) SetOwner(v string) { + o.Owner = v +} + +func (o DatabaseDocumentationCreateDatabaseRequestOptions) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DatabaseDocumentationCreateDatabaseRequestOptions) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Collation) { + toSerialize["collation"] = o.Collation + } + if !IsNil(o.CompatibilityLevel) { + toSerialize["compatibilityLevel"] = o.CompatibilityLevel + } + toSerialize["owner"] = o.Owner + return toSerialize, nil +} + +func (o *DatabaseDocumentationCreateDatabaseRequestOptions) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "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) + } + } + + varDatabaseDocumentationCreateDatabaseRequestOptions := _DatabaseDocumentationCreateDatabaseRequestOptions{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDatabaseDocumentationCreateDatabaseRequestOptions) + + if err != nil { + return err + } + + *o = DatabaseDocumentationCreateDatabaseRequestOptions(varDatabaseDocumentationCreateDatabaseRequestOptions) + + return err +} + +type NullableDatabaseDocumentationCreateDatabaseRequestOptions struct { + value *DatabaseDocumentationCreateDatabaseRequestOptions + isSet bool +} + +func (v NullableDatabaseDocumentationCreateDatabaseRequestOptions) Get() *DatabaseDocumentationCreateDatabaseRequestOptions { + return v.value +} + +func (v *NullableDatabaseDocumentationCreateDatabaseRequestOptions) Set(val *DatabaseDocumentationCreateDatabaseRequestOptions) { + v.value = val + v.isSet = true +} + +func (v NullableDatabaseDocumentationCreateDatabaseRequestOptions) IsSet() bool { + return v.isSet +} + +func (v *NullableDatabaseDocumentationCreateDatabaseRequestOptions) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDatabaseDocumentationCreateDatabaseRequestOptions(val *DatabaseDocumentationCreateDatabaseRequestOptions) *NullableDatabaseDocumentationCreateDatabaseRequestOptions { + return &NullableDatabaseDocumentationCreateDatabaseRequestOptions{value: val, isSet: true} +} + +func (v NullableDatabaseDocumentationCreateDatabaseRequestOptions) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDatabaseDocumentationCreateDatabaseRequestOptions) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_database_options.go b/services/sqlserverflex/v2api/model_database_options.go new file mode 100644 index 000000000..ff7d9c82c --- /dev/null +++ b/services/sqlserverflex/v2api/model_database_options.go @@ -0,0 +1,200 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 DatabaseOptions type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DatabaseOptions{} + +// DatabaseOptions struct for DatabaseOptions +type DatabaseOptions struct { + // Name of the collation of the database + CollationName *string `json:"collationName,omitempty"` + // CompatibilityLevel of the Database. + CompatibilityLevel *int64 `json:"compatibilityLevel,omitempty"` + // Name of the owner of the database. + Owner *string `json:"owner,omitempty"` +} + +// NewDatabaseOptions instantiates a new DatabaseOptions object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDatabaseOptions() *DatabaseOptions { + this := DatabaseOptions{} + return &this +} + +// NewDatabaseOptionsWithDefaults instantiates a new DatabaseOptions object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDatabaseOptionsWithDefaults() *DatabaseOptions { + this := DatabaseOptions{} + return &this +} + +// GetCollationName returns the CollationName field value if set, zero value otherwise. +func (o *DatabaseOptions) GetCollationName() string { + if o == nil || IsNil(o.CollationName) { + var ret string + return ret + } + return *o.CollationName +} + +// GetCollationNameOk returns a tuple with the CollationName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DatabaseOptions) GetCollationNameOk() (*string, bool) { + if o == nil || IsNil(o.CollationName) { + return nil, false + } + return o.CollationName, true +} + +// HasCollationName returns a boolean if a field has been set. +func (o *DatabaseOptions) HasCollationName() bool { + if o != nil && !IsNil(o.CollationName) { + return true + } + + return false +} + +// SetCollationName gets a reference to the given string and assigns it to the CollationName field. +func (o *DatabaseOptions) SetCollationName(v string) { + o.CollationName = &v +} + +// GetCompatibilityLevel returns the CompatibilityLevel field value if set, zero value otherwise. +func (o *DatabaseOptions) GetCompatibilityLevel() int64 { + if o == nil || IsNil(o.CompatibilityLevel) { + var ret int64 + return ret + } + return *o.CompatibilityLevel +} + +// GetCompatibilityLevelOk returns a tuple with the CompatibilityLevel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DatabaseOptions) GetCompatibilityLevelOk() (*int64, bool) { + if o == nil || IsNil(o.CompatibilityLevel) { + return nil, false + } + return o.CompatibilityLevel, true +} + +// HasCompatibilityLevel returns a boolean if a field has been set. +func (o *DatabaseOptions) HasCompatibilityLevel() bool { + if o != nil && !IsNil(o.CompatibilityLevel) { + return true + } + + return false +} + +// SetCompatibilityLevel gets a reference to the given int64 and assigns it to the CompatibilityLevel field. +func (o *DatabaseOptions) SetCompatibilityLevel(v int64) { + o.CompatibilityLevel = &v +} + +// GetOwner returns the Owner field value if set, zero value otherwise. +func (o *DatabaseOptions) 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 *DatabaseOptions) 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 *DatabaseOptions) 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 *DatabaseOptions) SetOwner(v string) { + o.Owner = &v +} + +func (o DatabaseOptions) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DatabaseOptions) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CollationName) { + toSerialize["collationName"] = o.CollationName + } + if !IsNil(o.CompatibilityLevel) { + toSerialize["compatibilityLevel"] = o.CompatibilityLevel + } + if !IsNil(o.Owner) { + toSerialize["owner"] = o.Owner + } + return toSerialize, nil +} + +type NullableDatabaseOptions struct { + value *DatabaseOptions + isSet bool +} + +func (v NullableDatabaseOptions) Get() *DatabaseOptions { + return v.value +} + +func (v *NullableDatabaseOptions) Set(val *DatabaseOptions) { + v.value = val + v.isSet = true +} + +func (v NullableDatabaseOptions) IsSet() bool { + return v.isSet +} + +func (v *NullableDatabaseOptions) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDatabaseOptions(val *DatabaseOptions) *NullableDatabaseOptions { + return &NullableDatabaseOptions{value: val, isSet: true} +} + +func (v NullableDatabaseOptions) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDatabaseOptions) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_flavor.go b/services/sqlserverflex/v2api/model_flavor.go new file mode 100644 index 000000000..300235fe6 --- /dev/null +++ b/services/sqlserverflex/v2api/model_flavor.go @@ -0,0 +1,233 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 *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/sqlserverflex/v2api/model_get_backup_response.go b/services/sqlserverflex/v2api/model_get_backup_response.go new file mode 100644 index 000000000..0dde10bc8 --- /dev/null +++ b/services/sqlserverflex/v2api/model_get_backup_response.go @@ -0,0 +1,385 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 { + // Backup end time represents local server time + EndTime *string `json:"endTime,omitempty"` + // Backup error + Error *string `json:"error,omitempty"` + // Backup id + Id *string `json:"id,omitempty"` + // Backup labels + Labels []string `json:"labels,omitempty"` + // Backup name + Name *string `json:"name,omitempty"` + // Backup specific options + Options *map[string]string `json:"options,omitempty"` + // Backup size in byte + Size *int64 `json:"size,omitempty"` + // Backup start time represents local server time + StartTime *string `json:"startTime,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 +} + +// GetEndTime returns the EndTime field value if set, zero value otherwise. +func (o *GetBackupResponse) 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 *GetBackupResponse) 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 *GetBackupResponse) 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 *GetBackupResponse) SetEndTime(v string) { + o.EndTime = &v +} + +// GetError returns the Error field value if set, zero value otherwise. +func (o *GetBackupResponse) 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 *GetBackupResponse) 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 *GetBackupResponse) 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 *GetBackupResponse) SetError(v string) { + o.Error = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *GetBackupResponse) 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 *GetBackupResponse) 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 *GetBackupResponse) 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 *GetBackupResponse) SetId(v string) { + o.Id = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *GetBackupResponse) 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 *GetBackupResponse) 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 *GetBackupResponse) 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 *GetBackupResponse) SetLabels(v []string) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *GetBackupResponse) 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 *GetBackupResponse) 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 *GetBackupResponse) 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 *GetBackupResponse) SetName(v string) { + o.Name = &v +} + +// GetOptions returns the Options field value if set, zero value otherwise. +func (o *GetBackupResponse) 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 *GetBackupResponse) 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 *GetBackupResponse) 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 *GetBackupResponse) SetOptions(v map[string]string) { + o.Options = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *GetBackupResponse) 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 *GetBackupResponse) 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 *GetBackupResponse) 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 *GetBackupResponse) SetSize(v int64) { + o.Size = &v +} + +// GetStartTime returns the StartTime field value if set, zero value otherwise. +func (o *GetBackupResponse) 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 *GetBackupResponse) 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 *GetBackupResponse) 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 *GetBackupResponse) SetStartTime(v string) { + o.StartTime = &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.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 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/sqlserverflex/v2api/model_get_database_response.go b/services/sqlserverflex/v2api/model_get_database_response.go new file mode 100644 index 000000000..e3181316d --- /dev/null +++ b/services/sqlserverflex/v2api/model_get_database_response.go @@ -0,0 +1,125 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 GetDatabaseResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetDatabaseResponse{} + +// GetDatabaseResponse struct for GetDatabaseResponse +type GetDatabaseResponse struct { + Database *SingleDatabase `json:"database,omitempty"` +} + +// 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() *GetDatabaseResponse { + this := GetDatabaseResponse{} + 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 +} + +// GetDatabase returns the Database field value if set, zero value otherwise. +func (o *GetDatabaseResponse) GetDatabase() SingleDatabase { + if o == nil || IsNil(o.Database) { + var ret SingleDatabase + 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 *GetDatabaseResponse) GetDatabaseOk() (*SingleDatabase, 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 *GetDatabaseResponse) HasDatabase() bool { + if o != nil && !IsNil(o.Database) { + return true + } + + return false +} + +// SetDatabase gets a reference to the given SingleDatabase and assigns it to the Database field. +func (o *GetDatabaseResponse) SetDatabase(v SingleDatabase) { + o.Database = &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{}{} + if !IsNil(o.Database) { + toSerialize["database"] = o.Database + } + return toSerialize, nil +} + +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/sqlserverflex/v2api/model_get_instance_response.go b/services/sqlserverflex/v2api/model_get_instance_response.go new file mode 100644 index 000000000..8086cbb6f --- /dev/null +++ b/services/sqlserverflex/v2api/model_get_instance_response.go @@ -0,0 +1,125 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 GetInstanceResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetInstanceResponse{} + +// GetInstanceResponse struct for GetInstanceResponse +type GetInstanceResponse struct { + Item *Instance `json:"item,omitempty"` +} + +// 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() *GetInstanceResponse { + this := GetInstanceResponse{} + 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 +} + +// GetItem returns the Item field value if set, zero value otherwise. +func (o *GetInstanceResponse) 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 *GetInstanceResponse) 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 *GetInstanceResponse) 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 *GetInstanceResponse) SetItem(v Instance) { + o.Item = &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.Item) { + toSerialize["item"] = o.Item + } + return toSerialize, nil +} + +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/sqlserverflex/v2api/model_get_user_response.go b/services/sqlserverflex/v2api/model_get_user_response.go new file mode 100644 index 000000000..8f9f83c00 --- /dev/null +++ b/services/sqlserverflex/v2api/model_get_user_response.go @@ -0,0 +1,125 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 *UserResponseUser `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() UserResponseUser { + if o == nil || IsNil(o.Item) { + var ret UserResponseUser + 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() (*UserResponseUser, 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 UserResponseUser and assigns it to the Item field. +func (o *GetUserResponse) SetItem(v UserResponseUser) { + 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/sqlserverflex/v2api/model_host.go b/services/sqlserverflex/v2api/model_host.go new file mode 100644 index 000000000..c873040bc --- /dev/null +++ b/services/sqlserverflex/v2api/model_host.go @@ -0,0 +1,161 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 Host type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Host{} + +// Host struct for Host +type Host struct { + HostMetrics []HostMetric `json:"hostMetrics,omitempty"` + Id *string `json:"id,omitempty"` +} + +// NewHost instantiates a new Host object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHost() *Host { + this := Host{} + return &this +} + +// NewHostWithDefaults instantiates a new Host object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHostWithDefaults() *Host { + this := Host{} + return &this +} + +// GetHostMetrics returns the HostMetrics field value if set, zero value otherwise. +func (o *Host) GetHostMetrics() []HostMetric { + if o == nil || IsNil(o.HostMetrics) { + var ret []HostMetric + 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 *Host) GetHostMetricsOk() ([]HostMetric, 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 *Host) HasHostMetrics() bool { + if o != nil && !IsNil(o.HostMetrics) { + return true + } + + return false +} + +// SetHostMetrics gets a reference to the given []HostMetric and assigns it to the HostMetrics field. +func (o *Host) SetHostMetrics(v []HostMetric) { + o.HostMetrics = v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Host) 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 *Host) 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 *Host) 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 *Host) SetId(v string) { + o.Id = &v +} + +func (o Host) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Host) 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 NullableHost struct { + value *Host + isSet bool +} + +func (v NullableHost) Get() *Host { + return v.value +} + +func (v *NullableHost) Set(val *Host) { + v.value = val + v.isSet = true +} + +func (v NullableHost) IsSet() bool { + return v.isSet +} + +func (v *NullableHost) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHost(val *Host) *NullableHost { + return &NullableHost{value: val, isSet: true} +} + +func (v NullableHost) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHost) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_host_metric.go b/services/sqlserverflex/v2api/model_host_metric.go new file mode 100644 index 000000000..ae6967dd9 --- /dev/null +++ b/services/sqlserverflex/v2api/model_host_metric.go @@ -0,0 +1,197 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 HostMetric type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HostMetric{} + +// HostMetric struct for HostMetric +type HostMetric struct { + Datapoints []DataPoint `json:"datapoints,omitempty"` + Name *string `json:"name,omitempty"` + Units *string `json:"units,omitempty"` +} + +// NewHostMetric instantiates a new HostMetric object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHostMetric() *HostMetric { + this := HostMetric{} + return &this +} + +// NewHostMetricWithDefaults instantiates a new HostMetric object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHostMetricWithDefaults() *HostMetric { + this := HostMetric{} + return &this +} + +// GetDatapoints returns the Datapoints field value if set, zero value otherwise. +func (o *HostMetric) GetDatapoints() []DataPoint { + if o == nil || IsNil(o.Datapoints) { + var ret []DataPoint + 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 *HostMetric) GetDatapointsOk() ([]DataPoint, 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 *HostMetric) HasDatapoints() bool { + if o != nil && !IsNil(o.Datapoints) { + return true + } + + return false +} + +// SetDatapoints gets a reference to the given []DataPoint and assigns it to the Datapoints field. +func (o *HostMetric) SetDatapoints(v []DataPoint) { + o.Datapoints = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *HostMetric) 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 *HostMetric) 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 *HostMetric) 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 *HostMetric) SetName(v string) { + o.Name = &v +} + +// GetUnits returns the Units field value if set, zero value otherwise. +func (o *HostMetric) 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 *HostMetric) 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 *HostMetric) 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 *HostMetric) SetUnits(v string) { + o.Units = &v +} + +func (o HostMetric) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HostMetric) 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 NullableHostMetric struct { + value *HostMetric + isSet bool +} + +func (v NullableHostMetric) Get() *HostMetric { + return v.value +} + +func (v *NullableHostMetric) Set(val *HostMetric) { + v.value = val + v.isSet = true +} + +func (v NullableHostMetric) IsSet() bool { + return v.isSet +} + +func (v *NullableHostMetric) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHostMetric(val *HostMetric) *NullableHostMetric { + return &NullableHostMetric{value: val, isSet: true} +} + +func (v NullableHostMetric) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHostMetric) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_instance.go b/services/sqlserverflex/v2api/model_instance.go new file mode 100644 index 000000000..0c62c9bcb --- /dev/null +++ b/services/sqlserverflex/v2api/model_instance.go @@ -0,0 +1,449 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v2api/model_instance_documentation_acl.go b/services/sqlserverflex/v2api/model_instance_documentation_acl.go new file mode 100644 index 000000000..97aa169c2 --- /dev/null +++ b/services/sqlserverflex/v2api/model_instance_documentation_acl.go @@ -0,0 +1,126 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 InstanceDocumentationACL type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceDocumentationACL{} + +// InstanceDocumentationACL struct for InstanceDocumentationACL +type InstanceDocumentationACL struct { + // a simple list with IP addresses with CIDR. + Items []string `json:"items,omitempty"` +} + +// NewInstanceDocumentationACL instantiates a new InstanceDocumentationACL object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceDocumentationACL() *InstanceDocumentationACL { + this := InstanceDocumentationACL{} + return &this +} + +// NewInstanceDocumentationACLWithDefaults instantiates a new InstanceDocumentationACL object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceDocumentationACLWithDefaults() *InstanceDocumentationACL { + this := InstanceDocumentationACL{} + return &this +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *InstanceDocumentationACL) 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 *InstanceDocumentationACL) 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 *InstanceDocumentationACL) 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 *InstanceDocumentationACL) SetItems(v []string) { + o.Items = v +} + +func (o InstanceDocumentationACL) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceDocumentationACL) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Items) { + toSerialize["items"] = o.Items + } + return toSerialize, nil +} + +type NullableInstanceDocumentationACL struct { + value *InstanceDocumentationACL + isSet bool +} + +func (v NullableInstanceDocumentationACL) Get() *InstanceDocumentationACL { + return v.value +} + +func (v *NullableInstanceDocumentationACL) Set(val *InstanceDocumentationACL) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceDocumentationACL) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceDocumentationACL) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceDocumentationACL(val *InstanceDocumentationACL) *NullableInstanceDocumentationACL { + return &NullableInstanceDocumentationACL{value: val, isSet: true} +} + +func (v NullableInstanceDocumentationACL) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceDocumentationACL) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_instance_documentation_options.go b/services/sqlserverflex/v2api/model_instance_documentation_options.go new file mode 100644 index 000000000..f18c4f2bf --- /dev/null +++ b/services/sqlserverflex/v2api/model_instance_documentation_options.go @@ -0,0 +1,171 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 InstanceDocumentationOptions type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceDocumentationOptions{} + +// InstanceDocumentationOptions struct for InstanceDocumentationOptions +type InstanceDocumentationOptions struct { + // Edition of the MSSQL server instance + Edition *string `json:"edition,omitempty"` + // The days for how long the backup files should be stored before cleaned up. 30 to 365 + RetentionDays *string `json:"retentionDays,omitempty"` +} + +// NewInstanceDocumentationOptions instantiates a new InstanceDocumentationOptions object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceDocumentationOptions() *InstanceDocumentationOptions { + this := InstanceDocumentationOptions{} + var edition string = "developer" + this.Edition = &edition + var retentionDays string = "32" + this.RetentionDays = &retentionDays + return &this +} + +// NewInstanceDocumentationOptionsWithDefaults instantiates a new InstanceDocumentationOptions object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceDocumentationOptionsWithDefaults() *InstanceDocumentationOptions { + this := InstanceDocumentationOptions{} + var edition string = "developer" + this.Edition = &edition + var retentionDays string = "32" + this.RetentionDays = &retentionDays + return &this +} + +// GetEdition returns the Edition field value if set, zero value otherwise. +func (o *InstanceDocumentationOptions) GetEdition() string { + if o == nil || IsNil(o.Edition) { + var ret string + return ret + } + return *o.Edition +} + +// GetEditionOk returns a tuple with the Edition field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceDocumentationOptions) GetEditionOk() (*string, bool) { + if o == nil || IsNil(o.Edition) { + return nil, false + } + return o.Edition, true +} + +// HasEdition returns a boolean if a field has been set. +func (o *InstanceDocumentationOptions) HasEdition() bool { + if o != nil && !IsNil(o.Edition) { + return true + } + + return false +} + +// SetEdition gets a reference to the given string and assigns it to the Edition field. +func (o *InstanceDocumentationOptions) SetEdition(v string) { + o.Edition = &v +} + +// GetRetentionDays returns the RetentionDays field value if set, zero value otherwise. +func (o *InstanceDocumentationOptions) GetRetentionDays() string { + if o == nil || IsNil(o.RetentionDays) { + var ret string + 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 *InstanceDocumentationOptions) GetRetentionDaysOk() (*string, 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 *InstanceDocumentationOptions) HasRetentionDays() bool { + if o != nil && !IsNil(o.RetentionDays) { + return true + } + + return false +} + +// SetRetentionDays gets a reference to the given string and assigns it to the RetentionDays field. +func (o *InstanceDocumentationOptions) SetRetentionDays(v string) { + o.RetentionDays = &v +} + +func (o InstanceDocumentationOptions) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceDocumentationOptions) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Edition) { + toSerialize["edition"] = o.Edition + } + if !IsNil(o.RetentionDays) { + toSerialize["retentionDays"] = o.RetentionDays + } + return toSerialize, nil +} + +type NullableInstanceDocumentationOptions struct { + value *InstanceDocumentationOptions + isSet bool +} + +func (v NullableInstanceDocumentationOptions) Get() *InstanceDocumentationOptions { + return v.value +} + +func (v *NullableInstanceDocumentationOptions) Set(val *InstanceDocumentationOptions) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceDocumentationOptions) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceDocumentationOptions) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceDocumentationOptions(val *InstanceDocumentationOptions) *NullableInstanceDocumentationOptions { + return &NullableInstanceDocumentationOptions{value: val, isSet: true} +} + +func (v NullableInstanceDocumentationOptions) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceDocumentationOptions) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_instance_documentation_storage.go b/services/sqlserverflex/v2api/model_instance_documentation_storage.go new file mode 100644 index 000000000..0b312b527 --- /dev/null +++ b/services/sqlserverflex/v2api/model_instance_documentation_storage.go @@ -0,0 +1,167 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 InstanceDocumentationStorage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceDocumentationStorage{} + +// InstanceDocumentationStorage struct for InstanceDocumentationStorage +type InstanceDocumentationStorage struct { + // Class of the instance. + Class *string `json:"class,omitempty"` + // Size of the instance storage in GB + Size *int64 `json:"size,omitempty"` +} + +// NewInstanceDocumentationStorage instantiates a new InstanceDocumentationStorage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceDocumentationStorage() *InstanceDocumentationStorage { + this := InstanceDocumentationStorage{} + var class string = "premium-perf12-stackit" + this.Class = &class + return &this +} + +// NewInstanceDocumentationStorageWithDefaults instantiates a new InstanceDocumentationStorage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceDocumentationStorageWithDefaults() *InstanceDocumentationStorage { + this := InstanceDocumentationStorage{} + var class string = "premium-perf12-stackit" + this.Class = &class + return &this +} + +// GetClass returns the Class field value if set, zero value otherwise. +func (o *InstanceDocumentationStorage) 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 *InstanceDocumentationStorage) 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 *InstanceDocumentationStorage) 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 *InstanceDocumentationStorage) SetClass(v string) { + o.Class = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *InstanceDocumentationStorage) 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 *InstanceDocumentationStorage) 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 *InstanceDocumentationStorage) 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 *InstanceDocumentationStorage) SetSize(v int64) { + o.Size = &v +} + +func (o InstanceDocumentationStorage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceDocumentationStorage) 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 NullableInstanceDocumentationStorage struct { + value *InstanceDocumentationStorage + isSet bool +} + +func (v NullableInstanceDocumentationStorage) Get() *InstanceDocumentationStorage { + return v.value +} + +func (v *NullableInstanceDocumentationStorage) Set(val *InstanceDocumentationStorage) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceDocumentationStorage) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceDocumentationStorage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceDocumentationStorage(val *InstanceDocumentationStorage) *NullableInstanceDocumentationStorage { + return &NullableInstanceDocumentationStorage{value: val, isSet: true} +} + +func (v NullableInstanceDocumentationStorage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceDocumentationStorage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_instance_error.go b/services/sqlserverflex/v2api/model_instance_error.go new file mode 100644 index 000000000..4eb731f17 --- /dev/null +++ b/services/sqlserverflex/v2api/model_instance_error.go @@ -0,0 +1,233 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 InstanceError type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceError{} + +// InstanceError struct for InstanceError +type InstanceError struct { + Code *int32 `json:"code,omitempty"` + Fields *map[string][]string `json:"fields,omitempty"` + Message *string `json:"message,omitempty"` + Type *Type `json:"type,omitempty"` +} + +// NewInstanceError instantiates a new InstanceError object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceError() *InstanceError { + this := InstanceError{} + return &this +} + +// NewInstanceErrorWithDefaults instantiates a new InstanceError object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceErrorWithDefaults() *InstanceError { + this := InstanceError{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *InstanceError) 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 *InstanceError) 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 *InstanceError) 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 *InstanceError) SetCode(v int32) { + o.Code = &v +} + +// GetFields returns the Fields field value if set, zero value otherwise. +func (o *InstanceError) 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 *InstanceError) 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 *InstanceError) 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 *InstanceError) SetFields(v map[string][]string) { + o.Fields = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *InstanceError) 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 *InstanceError) 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 *InstanceError) 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 *InstanceError) SetMessage(v string) { + o.Message = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *InstanceError) GetType() Type { + if o == nil || IsNil(o.Type) { + var ret Type + 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 *InstanceError) GetTypeOk() (*Type, 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 *InstanceError) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given Type and assigns it to the Type field. +func (o *InstanceError) SetType(v Type) { + o.Type = &v +} + +func (o InstanceError) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceError) 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 NullableInstanceError struct { + value *InstanceError + isSet bool +} + +func (v NullableInstanceError) Get() *InstanceError { + return v.value +} + +func (v *NullableInstanceError) Set(val *InstanceError) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceError) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceError(val *InstanceError) *NullableInstanceError { + return &NullableInstanceError{value: val, isSet: true} +} + +func (v NullableInstanceError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_instance_flavor_entry.go b/services/sqlserverflex/v2api/model_instance_flavor_entry.go new file mode 100644 index 000000000..fe4e38716 --- /dev/null +++ b/services/sqlserverflex/v2api/model_instance_flavor_entry.go @@ -0,0 +1,269 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 InstanceFlavorEntry type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceFlavorEntry{} + +// InstanceFlavorEntry struct for InstanceFlavorEntry +type InstanceFlavorEntry struct { + Categories *string `json:"categories,omitempty"` + Cpu *int32 `json:"cpu,omitempty"` + Description *string `json:"description,omitempty"` + Id *string `json:"id,omitempty"` + Memory *int32 `json:"memory,omitempty"` +} + +// NewInstanceFlavorEntry instantiates a new InstanceFlavorEntry object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceFlavorEntry() *InstanceFlavorEntry { + this := InstanceFlavorEntry{} + return &this +} + +// NewInstanceFlavorEntryWithDefaults instantiates a new InstanceFlavorEntry object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceFlavorEntryWithDefaults() *InstanceFlavorEntry { + this := InstanceFlavorEntry{} + return &this +} + +// GetCategories returns the Categories field value if set, zero value otherwise. +func (o *InstanceFlavorEntry) GetCategories() string { + if o == nil || IsNil(o.Categories) { + var ret string + return ret + } + return *o.Categories +} + +// GetCategoriesOk returns a tuple with the Categories field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceFlavorEntry) GetCategoriesOk() (*string, bool) { + if o == nil || IsNil(o.Categories) { + return nil, false + } + return o.Categories, true +} + +// HasCategories returns a boolean if a field has been set. +func (o *InstanceFlavorEntry) HasCategories() bool { + if o != nil && !IsNil(o.Categories) { + return true + } + + return false +} + +// SetCategories gets a reference to the given string and assigns it to the Categories field. +func (o *InstanceFlavorEntry) SetCategories(v string) { + o.Categories = &v +} + +// GetCpu returns the Cpu field value if set, zero value otherwise. +func (o *InstanceFlavorEntry) 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 *InstanceFlavorEntry) 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 *InstanceFlavorEntry) 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 *InstanceFlavorEntry) SetCpu(v int32) { + o.Cpu = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *InstanceFlavorEntry) 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 *InstanceFlavorEntry) 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 *InstanceFlavorEntry) 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 *InstanceFlavorEntry) SetDescription(v string) { + o.Description = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *InstanceFlavorEntry) 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 *InstanceFlavorEntry) 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 *InstanceFlavorEntry) 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 *InstanceFlavorEntry) SetId(v string) { + o.Id = &v +} + +// GetMemory returns the Memory field value if set, zero value otherwise. +func (o *InstanceFlavorEntry) 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 *InstanceFlavorEntry) 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 *InstanceFlavorEntry) 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 *InstanceFlavorEntry) SetMemory(v int32) { + o.Memory = &v +} + +func (o InstanceFlavorEntry) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceFlavorEntry) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Categories) { + toSerialize["categories"] = o.Categories + } + 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 NullableInstanceFlavorEntry struct { + value *InstanceFlavorEntry + isSet bool +} + +func (v NullableInstanceFlavorEntry) Get() *InstanceFlavorEntry { + return v.value +} + +func (v *NullableInstanceFlavorEntry) Set(val *InstanceFlavorEntry) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceFlavorEntry) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceFlavorEntry) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceFlavorEntry(val *InstanceFlavorEntry) *NullableInstanceFlavorEntry { + return &NullableInstanceFlavorEntry{value: val, isSet: true} +} + +func (v NullableInstanceFlavorEntry) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceFlavorEntry) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_instance_list_instance.go b/services/sqlserverflex/v2api/model_instance_list_instance.go new file mode 100644 index 000000000..d88f61bce --- /dev/null +++ b/services/sqlserverflex/v2api/model_instance_list_instance.go @@ -0,0 +1,197 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v2api/model_instance_list_user.go b/services/sqlserverflex/v2api/model_instance_list_user.go new file mode 100644 index 000000000..ff0598e0b --- /dev/null +++ b/services/sqlserverflex/v2api/model_instance_list_user.go @@ -0,0 +1,161 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 InstanceListUser type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceListUser{} + +// InstanceListUser struct for InstanceListUser +type InstanceListUser struct { + Id *string `json:"id,omitempty"` + Username *string `json:"username,omitempty"` +} + +// NewInstanceListUser instantiates a new InstanceListUser object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceListUser() *InstanceListUser { + this := InstanceListUser{} + return &this +} + +// NewInstanceListUserWithDefaults instantiates a new InstanceListUser object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceListUserWithDefaults() *InstanceListUser { + this := InstanceListUser{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *InstanceListUser) 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 *InstanceListUser) 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 *InstanceListUser) 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 *InstanceListUser) SetId(v string) { + o.Id = &v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *InstanceListUser) 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 *InstanceListUser) 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 *InstanceListUser) 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 *InstanceListUser) SetUsername(v string) { + o.Username = &v +} + +func (o InstanceListUser) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceListUser) 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 NullableInstanceListUser struct { + value *InstanceListUser + isSet bool +} + +func (v NullableInstanceListUser) Get() *InstanceListUser { + return v.value +} + +func (v *NullableInstanceListUser) Set(val *InstanceListUser) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceListUser) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceListUser) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceListUser(val *InstanceListUser) *NullableInstanceListUser { + return &NullableInstanceListUser{value: val, isSet: true} +} + +func (v NullableInstanceListUser) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceListUser) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_list_backups_response.go b/services/sqlserverflex/v2api/model_list_backups_response.go new file mode 100644 index 000000000..f9cb6cf1a --- /dev/null +++ b/services/sqlserverflex/v2api/model_list_backups_response.go @@ -0,0 +1,125 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 { + Databases []BackupListBackupsResponseGrouped `json:"databases,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 +} + +// GetDatabases returns the Databases field value if set, zero value otherwise. +func (o *ListBackupsResponse) GetDatabases() []BackupListBackupsResponseGrouped { + if o == nil || IsNil(o.Databases) { + var ret []BackupListBackupsResponseGrouped + 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 *ListBackupsResponse) GetDatabasesOk() ([]BackupListBackupsResponseGrouped, 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 *ListBackupsResponse) HasDatabases() bool { + if o != nil && !IsNil(o.Databases) { + return true + } + + return false +} + +// SetDatabases gets a reference to the given []BackupListBackupsResponseGrouped and assigns it to the Databases field. +func (o *ListBackupsResponse) SetDatabases(v []BackupListBackupsResponseGrouped) { + o.Databases = 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.Databases) { + toSerialize["databases"] = o.Databases + } + 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/sqlserverflex/v2api/model_list_collations_response.go b/services/sqlserverflex/v2api/model_list_collations_response.go new file mode 100644 index 000000000..ff5fc30d0 --- /dev/null +++ b/services/sqlserverflex/v2api/model_list_collations_response.go @@ -0,0 +1,125 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 ListCollationsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListCollationsResponse{} + +// ListCollationsResponse struct for ListCollationsResponse +type ListCollationsResponse struct { + Collations []MssqlDatabaseCollation `json:"collations,omitempty"` +} + +// NewListCollationsResponse instantiates a new ListCollationsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListCollationsResponse() *ListCollationsResponse { + this := ListCollationsResponse{} + return &this +} + +// NewListCollationsResponseWithDefaults instantiates a new ListCollationsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListCollationsResponseWithDefaults() *ListCollationsResponse { + this := ListCollationsResponse{} + return &this +} + +// GetCollations returns the Collations field value if set, zero value otherwise. +func (o *ListCollationsResponse) GetCollations() []MssqlDatabaseCollation { + if o == nil || IsNil(o.Collations) { + var ret []MssqlDatabaseCollation + return ret + } + return o.Collations +} + +// GetCollationsOk returns a tuple with the Collations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListCollationsResponse) GetCollationsOk() ([]MssqlDatabaseCollation, bool) { + if o == nil || IsNil(o.Collations) { + return nil, false + } + return o.Collations, true +} + +// HasCollations returns a boolean if a field has been set. +func (o *ListCollationsResponse) HasCollations() bool { + if o != nil && !IsNil(o.Collations) { + return true + } + + return false +} + +// SetCollations gets a reference to the given []MssqlDatabaseCollation and assigns it to the Collations field. +func (o *ListCollationsResponse) SetCollations(v []MssqlDatabaseCollation) { + o.Collations = v +} + +func (o ListCollationsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListCollationsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Collations) { + toSerialize["collations"] = o.Collations + } + return toSerialize, nil +} + +type NullableListCollationsResponse struct { + value *ListCollationsResponse + isSet bool +} + +func (v NullableListCollationsResponse) Get() *ListCollationsResponse { + return v.value +} + +func (v *NullableListCollationsResponse) Set(val *ListCollationsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListCollationsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListCollationsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListCollationsResponse(val *ListCollationsResponse) *NullableListCollationsResponse { + return &NullableListCollationsResponse{value: val, isSet: true} +} + +func (v NullableListCollationsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListCollationsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_list_compatibility_response.go b/services/sqlserverflex/v2api/model_list_compatibility_response.go new file mode 100644 index 000000000..88bcb5ae9 --- /dev/null +++ b/services/sqlserverflex/v2api/model_list_compatibility_response.go @@ -0,0 +1,125 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 ListCompatibilityResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListCompatibilityResponse{} + +// ListCompatibilityResponse struct for ListCompatibilityResponse +type ListCompatibilityResponse struct { + Compatibilities []MssqlDatabaseCompatibility `json:"compatibilities,omitempty"` +} + +// NewListCompatibilityResponse instantiates a new ListCompatibilityResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListCompatibilityResponse() *ListCompatibilityResponse { + this := ListCompatibilityResponse{} + return &this +} + +// NewListCompatibilityResponseWithDefaults instantiates a new ListCompatibilityResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListCompatibilityResponseWithDefaults() *ListCompatibilityResponse { + this := ListCompatibilityResponse{} + return &this +} + +// GetCompatibilities returns the Compatibilities field value if set, zero value otherwise. +func (o *ListCompatibilityResponse) GetCompatibilities() []MssqlDatabaseCompatibility { + if o == nil || IsNil(o.Compatibilities) { + var ret []MssqlDatabaseCompatibility + return ret + } + return o.Compatibilities +} + +// GetCompatibilitiesOk returns a tuple with the Compatibilities field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListCompatibilityResponse) GetCompatibilitiesOk() ([]MssqlDatabaseCompatibility, bool) { + if o == nil || IsNil(o.Compatibilities) { + return nil, false + } + return o.Compatibilities, true +} + +// HasCompatibilities returns a boolean if a field has been set. +func (o *ListCompatibilityResponse) HasCompatibilities() bool { + if o != nil && !IsNil(o.Compatibilities) { + return true + } + + return false +} + +// SetCompatibilities gets a reference to the given []MssqlDatabaseCompatibility and assigns it to the Compatibilities field. +func (o *ListCompatibilityResponse) SetCompatibilities(v []MssqlDatabaseCompatibility) { + o.Compatibilities = v +} + +func (o ListCompatibilityResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListCompatibilityResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Compatibilities) { + toSerialize["compatibilities"] = o.Compatibilities + } + return toSerialize, nil +} + +type NullableListCompatibilityResponse struct { + value *ListCompatibilityResponse + isSet bool +} + +func (v NullableListCompatibilityResponse) Get() *ListCompatibilityResponse { + return v.value +} + +func (v *NullableListCompatibilityResponse) Set(val *ListCompatibilityResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListCompatibilityResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListCompatibilityResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListCompatibilityResponse(val *ListCompatibilityResponse) *NullableListCompatibilityResponse { + return &NullableListCompatibilityResponse{value: val, isSet: true} +} + +func (v NullableListCompatibilityResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListCompatibilityResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_list_databases_response.go b/services/sqlserverflex/v2api/model_list_databases_response.go new file mode 100644 index 000000000..d47b94681 --- /dev/null +++ b/services/sqlserverflex/v2api/model_list_databases_response.go @@ -0,0 +1,125 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 ListDatabasesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListDatabasesResponse{} + +// ListDatabasesResponse struct for ListDatabasesResponse +type ListDatabasesResponse struct { + Databases []Database `json:"databases,omitempty"` +} + +// 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() *ListDatabasesResponse { + this := ListDatabasesResponse{} + 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 if set, zero value otherwise. +func (o *ListDatabasesResponse) GetDatabases() []Database { + if o == nil || IsNil(o.Databases) { + var ret []Database + 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 *ListDatabasesResponse) GetDatabasesOk() ([]Database, 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 *ListDatabasesResponse) HasDatabases() bool { + if o != nil && !IsNil(o.Databases) { + return true + } + + return false +} + +// SetDatabases gets a reference to the given []Database and assigns it to the Databases field. +func (o *ListDatabasesResponse) SetDatabases(v []Database) { + o.Databases = 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{}{} + if !IsNil(o.Databases) { + toSerialize["databases"] = o.Databases + } + return toSerialize, nil +} + +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/sqlserverflex/v2api/model_list_flavors_response.go b/services/sqlserverflex/v2api/model_list_flavors_response.go new file mode 100644 index 000000000..276542e54 --- /dev/null +++ b/services/sqlserverflex/v2api/model_list_flavors_response.go @@ -0,0 +1,125 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 []InstanceFlavorEntry `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() []InstanceFlavorEntry { + if o == nil || IsNil(o.Flavors) { + var ret []InstanceFlavorEntry + 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() ([]InstanceFlavorEntry, 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 []InstanceFlavorEntry and assigns it to the Flavors field. +func (o *ListFlavorsResponse) SetFlavors(v []InstanceFlavorEntry) { + 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/sqlserverflex/v2api/model_list_instances_response.go b/services/sqlserverflex/v2api/model_list_instances_response.go new file mode 100644 index 000000000..b12d99151 --- /dev/null +++ b/services/sqlserverflex/v2api/model_list_instances_response.go @@ -0,0 +1,161 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v2api/model_list_metrics_response.go b/services/sqlserverflex/v2api/model_list_metrics_response.go new file mode 100644 index 000000000..ff00a7eed --- /dev/null +++ b/services/sqlserverflex/v2api/model_list_metrics_response.go @@ -0,0 +1,125 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 ListMetricsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListMetricsResponse{} + +// ListMetricsResponse struct for ListMetricsResponse +type ListMetricsResponse struct { + Hosts []Host `json:"hosts,omitempty"` +} + +// NewListMetricsResponse instantiates a new ListMetricsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListMetricsResponse() *ListMetricsResponse { + this := ListMetricsResponse{} + return &this +} + +// NewListMetricsResponseWithDefaults instantiates a new ListMetricsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListMetricsResponseWithDefaults() *ListMetricsResponse { + this := ListMetricsResponse{} + return &this +} + +// GetHosts returns the Hosts field value if set, zero value otherwise. +func (o *ListMetricsResponse) GetHosts() []Host { + if o == nil || IsNil(o.Hosts) { + var ret []Host + 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 *ListMetricsResponse) GetHostsOk() ([]Host, 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 *ListMetricsResponse) HasHosts() bool { + if o != nil && !IsNil(o.Hosts) { + return true + } + + return false +} + +// SetHosts gets a reference to the given []Host and assigns it to the Hosts field. +func (o *ListMetricsResponse) SetHosts(v []Host) { + o.Hosts = v +} + +func (o ListMetricsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListMetricsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Hosts) { + toSerialize["hosts"] = o.Hosts + } + return toSerialize, nil +} + +type NullableListMetricsResponse struct { + value *ListMetricsResponse + isSet bool +} + +func (v NullableListMetricsResponse) Get() *ListMetricsResponse { + return v.value +} + +func (v *NullableListMetricsResponse) Set(val *ListMetricsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListMetricsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListMetricsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListMetricsResponse(val *ListMetricsResponse) *NullableListMetricsResponse { + return &NullableListMetricsResponse{value: val, isSet: true} +} + +func (v NullableListMetricsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListMetricsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_list_restore_jobs_response.go b/services/sqlserverflex/v2api/model_list_restore_jobs_response.go new file mode 100644 index 000000000..61eb26747 --- /dev/null +++ b/services/sqlserverflex/v2api/model_list_restore_jobs_response.go @@ -0,0 +1,125 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 ListRestoreJobsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListRestoreJobsResponse{} + +// ListRestoreJobsResponse struct for ListRestoreJobsResponse +type ListRestoreJobsResponse struct { + RunningRestores []RestoreRunningRestore `json:"runningRestores,omitempty"` +} + +// NewListRestoreJobsResponse instantiates a new ListRestoreJobsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListRestoreJobsResponse() *ListRestoreJobsResponse { + this := ListRestoreJobsResponse{} + return &this +} + +// NewListRestoreJobsResponseWithDefaults instantiates a new ListRestoreJobsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListRestoreJobsResponseWithDefaults() *ListRestoreJobsResponse { + this := ListRestoreJobsResponse{} + return &this +} + +// GetRunningRestores returns the RunningRestores field value if set, zero value otherwise. +func (o *ListRestoreJobsResponse) GetRunningRestores() []RestoreRunningRestore { + if o == nil || IsNil(o.RunningRestores) { + var ret []RestoreRunningRestore + return ret + } + return o.RunningRestores +} + +// GetRunningRestoresOk returns a tuple with the RunningRestores field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListRestoreJobsResponse) GetRunningRestoresOk() ([]RestoreRunningRestore, bool) { + if o == nil || IsNil(o.RunningRestores) { + return nil, false + } + return o.RunningRestores, true +} + +// HasRunningRestores returns a boolean if a field has been set. +func (o *ListRestoreJobsResponse) HasRunningRestores() bool { + if o != nil && !IsNil(o.RunningRestores) { + return true + } + + return false +} + +// SetRunningRestores gets a reference to the given []RestoreRunningRestore and assigns it to the RunningRestores field. +func (o *ListRestoreJobsResponse) SetRunningRestores(v []RestoreRunningRestore) { + o.RunningRestores = v +} + +func (o ListRestoreJobsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListRestoreJobsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.RunningRestores) { + toSerialize["runningRestores"] = o.RunningRestores + } + return toSerialize, nil +} + +type NullableListRestoreJobsResponse struct { + value *ListRestoreJobsResponse + isSet bool +} + +func (v NullableListRestoreJobsResponse) Get() *ListRestoreJobsResponse { + return v.value +} + +func (v *NullableListRestoreJobsResponse) Set(val *ListRestoreJobsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListRestoreJobsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListRestoreJobsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListRestoreJobsResponse(val *ListRestoreJobsResponse) *NullableListRestoreJobsResponse { + return &NullableListRestoreJobsResponse{value: val, isSet: true} +} + +func (v NullableListRestoreJobsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListRestoreJobsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_list_roles_response.go b/services/sqlserverflex/v2api/model_list_roles_response.go new file mode 100644 index 000000000..ee25c1cc9 --- /dev/null +++ b/services/sqlserverflex/v2api/model_list_roles_response.go @@ -0,0 +1,125 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 ListRolesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListRolesResponse{} + +// ListRolesResponse struct for ListRolesResponse +type ListRolesResponse struct { + Roles []string `json:"roles,omitempty"` +} + +// 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() *ListRolesResponse { + this := ListRolesResponse{} + 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 if set, zero value otherwise. +func (o *ListRolesResponse) 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 *ListRolesResponse) 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 *ListRolesResponse) 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 *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{}{} + if !IsNil(o.Roles) { + toSerialize["roles"] = o.Roles + } + return toSerialize, nil +} + +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/sqlserverflex/v2api/model_list_storages_response.go b/services/sqlserverflex/v2api/model_list_storages_response.go new file mode 100644 index 000000000..6eafc2b2d --- /dev/null +++ b/services/sqlserverflex/v2api/model_list_storages_response.go @@ -0,0 +1,161 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v2api/model_list_users_response.go b/services/sqlserverflex/v2api/model_list_users_response.go new file mode 100644 index 000000000..fc5f6c6f2 --- /dev/null +++ b/services/sqlserverflex/v2api/model_list_users_response.go @@ -0,0 +1,161 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 []InstanceListUser `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() []InstanceListUser { + if o == nil || IsNil(o.Items) { + var ret []InstanceListUser + 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() ([]InstanceListUser, 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 []InstanceListUser and assigns it to the Items field. +func (o *ListUsersResponse) SetItems(v []InstanceListUser) { + 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/sqlserverflex/v2api/model_list_versions_response.go b/services/sqlserverflex/v2api/model_list_versions_response.go new file mode 100644 index 000000000..8d604d15b --- /dev/null +++ b/services/sqlserverflex/v2api/model_list_versions_response.go @@ -0,0 +1,125 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v2api/model_mssql_database_collation.go b/services/sqlserverflex/v2api/model_mssql_database_collation.go new file mode 100644 index 000000000..116f679cc --- /dev/null +++ b/services/sqlserverflex/v2api/model_mssql_database_collation.go @@ -0,0 +1,161 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 MssqlDatabaseCollation type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MssqlDatabaseCollation{} + +// MssqlDatabaseCollation struct for MssqlDatabaseCollation +type MssqlDatabaseCollation struct { + CollationName *string `json:"collation_name,omitempty"` + Description *string `json:"description,omitempty"` +} + +// NewMssqlDatabaseCollation instantiates a new MssqlDatabaseCollation object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMssqlDatabaseCollation() *MssqlDatabaseCollation { + this := MssqlDatabaseCollation{} + return &this +} + +// NewMssqlDatabaseCollationWithDefaults instantiates a new MssqlDatabaseCollation object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMssqlDatabaseCollationWithDefaults() *MssqlDatabaseCollation { + this := MssqlDatabaseCollation{} + return &this +} + +// GetCollationName returns the CollationName field value if set, zero value otherwise. +func (o *MssqlDatabaseCollation) GetCollationName() string { + if o == nil || IsNil(o.CollationName) { + var ret string + return ret + } + return *o.CollationName +} + +// GetCollationNameOk returns a tuple with the CollationName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MssqlDatabaseCollation) GetCollationNameOk() (*string, bool) { + if o == nil || IsNil(o.CollationName) { + return nil, false + } + return o.CollationName, true +} + +// HasCollationName returns a boolean if a field has been set. +func (o *MssqlDatabaseCollation) HasCollationName() bool { + if o != nil && !IsNil(o.CollationName) { + return true + } + + return false +} + +// SetCollationName gets a reference to the given string and assigns it to the CollationName field. +func (o *MssqlDatabaseCollation) SetCollationName(v string) { + o.CollationName = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *MssqlDatabaseCollation) 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 *MssqlDatabaseCollation) 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 *MssqlDatabaseCollation) 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 *MssqlDatabaseCollation) SetDescription(v string) { + o.Description = &v +} + +func (o MssqlDatabaseCollation) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MssqlDatabaseCollation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CollationName) { + toSerialize["collation_name"] = o.CollationName + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + return toSerialize, nil +} + +type NullableMssqlDatabaseCollation struct { + value *MssqlDatabaseCollation + isSet bool +} + +func (v NullableMssqlDatabaseCollation) Get() *MssqlDatabaseCollation { + return v.value +} + +func (v *NullableMssqlDatabaseCollation) Set(val *MssqlDatabaseCollation) { + v.value = val + v.isSet = true +} + +func (v NullableMssqlDatabaseCollation) IsSet() bool { + return v.isSet +} + +func (v *NullableMssqlDatabaseCollation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMssqlDatabaseCollation(val *MssqlDatabaseCollation) *NullableMssqlDatabaseCollation { + return &NullableMssqlDatabaseCollation{value: val, isSet: true} +} + +func (v NullableMssqlDatabaseCollation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMssqlDatabaseCollation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_mssql_database_compatibility.go b/services/sqlserverflex/v2api/model_mssql_database_compatibility.go new file mode 100644 index 000000000..5547d674a --- /dev/null +++ b/services/sqlserverflex/v2api/model_mssql_database_compatibility.go @@ -0,0 +1,161 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 MssqlDatabaseCompatibility type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MssqlDatabaseCompatibility{} + +// MssqlDatabaseCompatibility struct for MssqlDatabaseCompatibility +type MssqlDatabaseCompatibility struct { + CompatibilityLevel *int64 `json:"compatibility_level,omitempty"` + Description *string `json:"description,omitempty"` +} + +// NewMssqlDatabaseCompatibility instantiates a new MssqlDatabaseCompatibility object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMssqlDatabaseCompatibility() *MssqlDatabaseCompatibility { + this := MssqlDatabaseCompatibility{} + return &this +} + +// NewMssqlDatabaseCompatibilityWithDefaults instantiates a new MssqlDatabaseCompatibility object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMssqlDatabaseCompatibilityWithDefaults() *MssqlDatabaseCompatibility { + this := MssqlDatabaseCompatibility{} + return &this +} + +// GetCompatibilityLevel returns the CompatibilityLevel field value if set, zero value otherwise. +func (o *MssqlDatabaseCompatibility) GetCompatibilityLevel() int64 { + if o == nil || IsNil(o.CompatibilityLevel) { + var ret int64 + return ret + } + return *o.CompatibilityLevel +} + +// GetCompatibilityLevelOk returns a tuple with the CompatibilityLevel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MssqlDatabaseCompatibility) GetCompatibilityLevelOk() (*int64, bool) { + if o == nil || IsNil(o.CompatibilityLevel) { + return nil, false + } + return o.CompatibilityLevel, true +} + +// HasCompatibilityLevel returns a boolean if a field has been set. +func (o *MssqlDatabaseCompatibility) HasCompatibilityLevel() bool { + if o != nil && !IsNil(o.CompatibilityLevel) { + return true + } + + return false +} + +// SetCompatibilityLevel gets a reference to the given int64 and assigns it to the CompatibilityLevel field. +func (o *MssqlDatabaseCompatibility) SetCompatibilityLevel(v int64) { + o.CompatibilityLevel = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *MssqlDatabaseCompatibility) 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 *MssqlDatabaseCompatibility) 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 *MssqlDatabaseCompatibility) 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 *MssqlDatabaseCompatibility) SetDescription(v string) { + o.Description = &v +} + +func (o MssqlDatabaseCompatibility) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MssqlDatabaseCompatibility) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CompatibilityLevel) { + toSerialize["compatibility_level"] = o.CompatibilityLevel + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + return toSerialize, nil +} + +type NullableMssqlDatabaseCompatibility struct { + value *MssqlDatabaseCompatibility + isSet bool +} + +func (v NullableMssqlDatabaseCompatibility) Get() *MssqlDatabaseCompatibility { + return v.value +} + +func (v *NullableMssqlDatabaseCompatibility) Set(val *MssqlDatabaseCompatibility) { + v.value = val + v.isSet = true +} + +func (v NullableMssqlDatabaseCompatibility) IsSet() bool { + return v.isSet +} + +func (v *NullableMssqlDatabaseCompatibility) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMssqlDatabaseCompatibility(val *MssqlDatabaseCompatibility) *NullableMssqlDatabaseCompatibility { + return &NullableMssqlDatabaseCompatibility{value: val, isSet: true} +} + +func (v NullableMssqlDatabaseCompatibility) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMssqlDatabaseCompatibility) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_partial_update_instance_payload.go b/services/sqlserverflex/v2api/model_partial_update_instance_payload.go new file mode 100644 index 000000000..dbe485703 --- /dev/null +++ b/services/sqlserverflex/v2api/model_partial_update_instance_payload.go @@ -0,0 +1,315 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 is the Access Control List defining the IP ranges allowed to connect to the database + Acl *InstanceDocumentationACL `json:"acl,omitempty"` + // Cronjob for the daily full backup if not provided a job will generated between 00:00 and 04:59 + BackupSchedule *string `json:"backupSchedule,omitempty"` + // Id of the selected flavor + FlavorId *string `json:"flavorId,omitempty"` + // Labels for the instance + Labels map[string]interface{} `json:"labels,omitempty"` + // Name of the instance + Name *string `json:"name,omitempty"` + // Version of the MSSQL Server + 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{} + var version string = "2022" + this.Version = &version + 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{} + var version string = "2022" + this.Version = &version + return &this +} + +// GetAcl returns the Acl field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetAcl() InstanceDocumentationACL { + if o == nil || IsNil(o.Acl) { + var ret InstanceDocumentationACL + 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() (*InstanceDocumentationACL, 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 InstanceDocumentationACL and assigns it to the Acl field. +func (o *PartialUpdateInstancePayload) SetAcl(v InstanceDocumentationACL) { + 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]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *PartialUpdateInstancePayload) SetLabels(v map[string]interface{}) { + 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 +} + +// 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.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/sqlserverflex/v2api/model_reset_user_response.go b/services/sqlserverflex/v2api/model_reset_user_response.go new file mode 100644 index 000000000..f48420122 --- /dev/null +++ b/services/sqlserverflex/v2api/model_reset_user_response.go @@ -0,0 +1,125 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 *SingleUser `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() SingleUser { + if o == nil || IsNil(o.Item) { + var ret SingleUser + 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() (*SingleUser, 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 SingleUser and assigns it to the Item field. +func (o *ResetUserResponse) SetItem(v SingleUser) { + 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/sqlserverflex/v2api/model_restore_running_restore.go b/services/sqlserverflex/v2api/model_restore_running_restore.go new file mode 100644 index 000000000..5b2e16adb --- /dev/null +++ b/services/sqlserverflex/v2api/model_restore_running_restore.go @@ -0,0 +1,269 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 RestoreRunningRestore type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RestoreRunningRestore{} + +// RestoreRunningRestore struct for RestoreRunningRestore +type RestoreRunningRestore struct { + Command *string `json:"command,omitempty"` + DatabaseName *string `json:"database_name,omitempty"` + EstimatedCompletionTime *string `json:"estimated_completion_time,omitempty"` + PercentComplete *int32 `json:"percent_complete,omitempty"` + StartTime *string `json:"start_time,omitempty"` +} + +// NewRestoreRunningRestore instantiates a new RestoreRunningRestore object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRestoreRunningRestore() *RestoreRunningRestore { + this := RestoreRunningRestore{} + return &this +} + +// NewRestoreRunningRestoreWithDefaults instantiates a new RestoreRunningRestore object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRestoreRunningRestoreWithDefaults() *RestoreRunningRestore { + this := RestoreRunningRestore{} + return &this +} + +// GetCommand returns the Command field value if set, zero value otherwise. +func (o *RestoreRunningRestore) GetCommand() string { + if o == nil || IsNil(o.Command) { + var ret string + return ret + } + return *o.Command +} + +// GetCommandOk returns a tuple with the Command field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RestoreRunningRestore) GetCommandOk() (*string, bool) { + if o == nil || IsNil(o.Command) { + return nil, false + } + return o.Command, true +} + +// HasCommand returns a boolean if a field has been set. +func (o *RestoreRunningRestore) HasCommand() bool { + if o != nil && !IsNil(o.Command) { + return true + } + + return false +} + +// SetCommand gets a reference to the given string and assigns it to the Command field. +func (o *RestoreRunningRestore) SetCommand(v string) { + o.Command = &v +} + +// GetDatabaseName returns the DatabaseName field value if set, zero value otherwise. +func (o *RestoreRunningRestore) GetDatabaseName() string { + if o == nil || IsNil(o.DatabaseName) { + var ret string + return ret + } + return *o.DatabaseName +} + +// GetDatabaseNameOk returns a tuple with the DatabaseName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RestoreRunningRestore) GetDatabaseNameOk() (*string, bool) { + if o == nil || IsNil(o.DatabaseName) { + return nil, false + } + return o.DatabaseName, true +} + +// HasDatabaseName returns a boolean if a field has been set. +func (o *RestoreRunningRestore) HasDatabaseName() bool { + if o != nil && !IsNil(o.DatabaseName) { + return true + } + + return false +} + +// SetDatabaseName gets a reference to the given string and assigns it to the DatabaseName field. +func (o *RestoreRunningRestore) SetDatabaseName(v string) { + o.DatabaseName = &v +} + +// GetEstimatedCompletionTime returns the EstimatedCompletionTime field value if set, zero value otherwise. +func (o *RestoreRunningRestore) GetEstimatedCompletionTime() string { + if o == nil || IsNil(o.EstimatedCompletionTime) { + var ret string + return ret + } + return *o.EstimatedCompletionTime +} + +// GetEstimatedCompletionTimeOk returns a tuple with the EstimatedCompletionTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RestoreRunningRestore) GetEstimatedCompletionTimeOk() (*string, bool) { + if o == nil || IsNil(o.EstimatedCompletionTime) { + return nil, false + } + return o.EstimatedCompletionTime, true +} + +// HasEstimatedCompletionTime returns a boolean if a field has been set. +func (o *RestoreRunningRestore) HasEstimatedCompletionTime() bool { + if o != nil && !IsNil(o.EstimatedCompletionTime) { + return true + } + + return false +} + +// SetEstimatedCompletionTime gets a reference to the given string and assigns it to the EstimatedCompletionTime field. +func (o *RestoreRunningRestore) SetEstimatedCompletionTime(v string) { + o.EstimatedCompletionTime = &v +} + +// GetPercentComplete returns the PercentComplete field value if set, zero value otherwise. +func (o *RestoreRunningRestore) GetPercentComplete() int32 { + if o == nil || IsNil(o.PercentComplete) { + var ret int32 + return ret + } + return *o.PercentComplete +} + +// GetPercentCompleteOk returns a tuple with the PercentComplete field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RestoreRunningRestore) GetPercentCompleteOk() (*int32, bool) { + if o == nil || IsNil(o.PercentComplete) { + return nil, false + } + return o.PercentComplete, true +} + +// HasPercentComplete returns a boolean if a field has been set. +func (o *RestoreRunningRestore) HasPercentComplete() bool { + if o != nil && !IsNil(o.PercentComplete) { + return true + } + + return false +} + +// SetPercentComplete gets a reference to the given int32 and assigns it to the PercentComplete field. +func (o *RestoreRunningRestore) SetPercentComplete(v int32) { + o.PercentComplete = &v +} + +// GetStartTime returns the StartTime field value if set, zero value otherwise. +func (o *RestoreRunningRestore) 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 *RestoreRunningRestore) 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 *RestoreRunningRestore) 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 *RestoreRunningRestore) SetStartTime(v string) { + o.StartTime = &v +} + +func (o RestoreRunningRestore) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RestoreRunningRestore) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Command) { + toSerialize["command"] = o.Command + } + if !IsNil(o.DatabaseName) { + toSerialize["database_name"] = o.DatabaseName + } + if !IsNil(o.EstimatedCompletionTime) { + toSerialize["estimated_completion_time"] = o.EstimatedCompletionTime + } + if !IsNil(o.PercentComplete) { + toSerialize["percent_complete"] = o.PercentComplete + } + if !IsNil(o.StartTime) { + toSerialize["start_time"] = o.StartTime + } + return toSerialize, nil +} + +type NullableRestoreRunningRestore struct { + value *RestoreRunningRestore + isSet bool +} + +func (v NullableRestoreRunningRestore) Get() *RestoreRunningRestore { + return v.value +} + +func (v *NullableRestoreRunningRestore) Set(val *RestoreRunningRestore) { + v.value = val + v.isSet = true +} + +func (v NullableRestoreRunningRestore) IsSet() bool { + return v.isSet +} + +func (v *NullableRestoreRunningRestore) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRestoreRunningRestore(val *RestoreRunningRestore) *NullableRestoreRunningRestore { + return &NullableRestoreRunningRestore{value: val, isSet: true} +} + +func (v NullableRestoreRunningRestore) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRestoreRunningRestore) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_single_database.go b/services/sqlserverflex/v2api/model_single_database.go new file mode 100644 index 000000000..3e4b093e4 --- /dev/null +++ b/services/sqlserverflex/v2api/model_single_database.go @@ -0,0 +1,200 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 SingleDatabase type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SingleDatabase{} + +// SingleDatabase struct for SingleDatabase +type SingleDatabase struct { + // Database id + Id *string `json:"id,omitempty"` + // Database name + Name *string `json:"name,omitempty"` + // Database specific options + Options *DatabaseOptions `json:"options,omitempty"` +} + +// NewSingleDatabase instantiates a new SingleDatabase object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSingleDatabase() *SingleDatabase { + this := SingleDatabase{} + return &this +} + +// NewSingleDatabaseWithDefaults instantiates a new SingleDatabase object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSingleDatabaseWithDefaults() *SingleDatabase { + this := SingleDatabase{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SingleDatabase) 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 *SingleDatabase) 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 *SingleDatabase) 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 *SingleDatabase) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *SingleDatabase) 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 *SingleDatabase) 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 *SingleDatabase) 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 *SingleDatabase) SetName(v string) { + o.Name = &v +} + +// GetOptions returns the Options field value if set, zero value otherwise. +func (o *SingleDatabase) GetOptions() DatabaseOptions { + if o == nil || IsNil(o.Options) { + var ret DatabaseOptions + 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 *SingleDatabase) GetOptionsOk() (*DatabaseOptions, 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 *SingleDatabase) HasOptions() bool { + if o != nil && !IsNil(o.Options) { + return true + } + + return false +} + +// SetOptions gets a reference to the given DatabaseOptions and assigns it to the Options field. +func (o *SingleDatabase) SetOptions(v DatabaseOptions) { + o.Options = &v +} + +func (o SingleDatabase) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SingleDatabase) 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 NullableSingleDatabase struct { + value *SingleDatabase + isSet bool +} + +func (v NullableSingleDatabase) Get() *SingleDatabase { + return v.value +} + +func (v *NullableSingleDatabase) Set(val *SingleDatabase) { + v.value = val + v.isSet = true +} + +func (v NullableSingleDatabase) IsSet() bool { + return v.isSet +} + +func (v *NullableSingleDatabase) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSingleDatabase(val *SingleDatabase) *NullableSingleDatabase { + return &NullableSingleDatabase{value: val, isSet: true} +} + +func (v NullableSingleDatabase) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSingleDatabase) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_single_user.go b/services/sqlserverflex/v2api/model_single_user.go new file mode 100644 index 000000000..9319e3254 --- /dev/null +++ b/services/sqlserverflex/v2api/model_single_user.go @@ -0,0 +1,377 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 SingleUser type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SingleUser{} + +// SingleUser struct for SingleUser +type SingleUser struct { + DefaultDatabase *string `json:"default_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"` +} + +// NewSingleUser instantiates a new SingleUser object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSingleUser() *SingleUser { + this := SingleUser{} + return &this +} + +// NewSingleUserWithDefaults instantiates a new SingleUser object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSingleUserWithDefaults() *SingleUser { + this := SingleUser{} + return &this +} + +// GetDefaultDatabase returns the DefaultDatabase field value if set, zero value otherwise. +func (o *SingleUser) GetDefaultDatabase() string { + if o == nil || IsNil(o.DefaultDatabase) { + var ret string + return ret + } + return *o.DefaultDatabase +} + +// GetDefaultDatabaseOk returns a tuple with the DefaultDatabase field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SingleUser) GetDefaultDatabaseOk() (*string, bool) { + if o == nil || IsNil(o.DefaultDatabase) { + return nil, false + } + return o.DefaultDatabase, true +} + +// HasDefaultDatabase returns a boolean if a field has been set. +func (o *SingleUser) HasDefaultDatabase() bool { + if o != nil && !IsNil(o.DefaultDatabase) { + return true + } + + return false +} + +// SetDefaultDatabase gets a reference to the given string and assigns it to the DefaultDatabase field. +func (o *SingleUser) SetDefaultDatabase(v string) { + o.DefaultDatabase = &v +} + +// GetHost returns the Host field value if set, zero value otherwise. +func (o *SingleUser) 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 *SingleUser) 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 *SingleUser) 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 *SingleUser) SetHost(v string) { + o.Host = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SingleUser) 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 *SingleUser) 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 *SingleUser) 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 *SingleUser) SetId(v string) { + o.Id = &v +} + +// GetPassword returns the Password field value if set, zero value otherwise. +func (o *SingleUser) 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 *SingleUser) 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 *SingleUser) 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 *SingleUser) SetPassword(v string) { + o.Password = &v +} + +// GetPort returns the Port field value if set, zero value otherwise. +func (o *SingleUser) 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 *SingleUser) 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 *SingleUser) 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 *SingleUser) SetPort(v int64) { + o.Port = &v +} + +// GetRoles returns the Roles field value if set, zero value otherwise. +func (o *SingleUser) 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 *SingleUser) 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 *SingleUser) 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 *SingleUser) SetRoles(v []string) { + o.Roles = v +} + +// GetUri returns the Uri field value if set, zero value otherwise. +func (o *SingleUser) 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 *SingleUser) 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 *SingleUser) 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 *SingleUser) SetUri(v string) { + o.Uri = &v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *SingleUser) 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 *SingleUser) 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 *SingleUser) 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 *SingleUser) SetUsername(v string) { + o.Username = &v +} + +func (o SingleUser) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SingleUser) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DefaultDatabase) { + toSerialize["default_database"] = o.DefaultDatabase + } + 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 NullableSingleUser struct { + value *SingleUser + isSet bool +} + +func (v NullableSingleUser) Get() *SingleUser { + return v.value +} + +func (v *NullableSingleUser) Set(val *SingleUser) { + v.value = val + v.isSet = true +} + +func (v NullableSingleUser) IsSet() bool { + return v.isSet +} + +func (v *NullableSingleUser) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSingleUser(val *SingleUser) *NullableSingleUser { + return &NullableSingleUser{value: val, isSet: true} +} + +func (v NullableSingleUser) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSingleUser) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_storage.go b/services/sqlserverflex/v2api/model_storage.go new file mode 100644 index 000000000..3fcea8333 --- /dev/null +++ b/services/sqlserverflex/v2api/model_storage.go @@ -0,0 +1,161 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v2api/model_storage_range.go b/services/sqlserverflex/v2api/model_storage_range.go new file mode 100644 index 000000000..e67dab66a --- /dev/null +++ b/services/sqlserverflex/v2api/model_storage_range.go @@ -0,0 +1,161 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v2api/model_trigger_database_restore_payload.go b/services/sqlserverflex/v2api/model_trigger_database_restore_payload.go new file mode 100644 index 000000000..1b9c5e71f --- /dev/null +++ b/services/sqlserverflex/v2api/model_trigger_database_restore_payload.go @@ -0,0 +1,187 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 TriggerDatabaseRestorePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TriggerDatabaseRestorePayload{} + +// TriggerDatabaseRestorePayload struct for TriggerDatabaseRestorePayload +type TriggerDatabaseRestorePayload struct { + // Name for the restored database no overwrite allowed at the moment + Name string `json:"name"` + // Time of the restore point formate RFC3339 + RestoreDateTime string `json:"restoreDateTime"` +} + +type _TriggerDatabaseRestorePayload TriggerDatabaseRestorePayload + +// NewTriggerDatabaseRestorePayload instantiates a new TriggerDatabaseRestorePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTriggerDatabaseRestorePayload(name string, restoreDateTime string) *TriggerDatabaseRestorePayload { + this := TriggerDatabaseRestorePayload{} + this.Name = name + this.RestoreDateTime = restoreDateTime + return &this +} + +// NewTriggerDatabaseRestorePayloadWithDefaults instantiates a new TriggerDatabaseRestorePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTriggerDatabaseRestorePayloadWithDefaults() *TriggerDatabaseRestorePayload { + this := TriggerDatabaseRestorePayload{} + return &this +} + +// GetName returns the Name field value +func (o *TriggerDatabaseRestorePayload) 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 *TriggerDatabaseRestorePayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *TriggerDatabaseRestorePayload) SetName(v string) { + o.Name = v +} + +// GetRestoreDateTime returns the RestoreDateTime field value +func (o *TriggerDatabaseRestorePayload) GetRestoreDateTime() string { + if o == nil { + var ret string + return ret + } + + return o.RestoreDateTime +} + +// GetRestoreDateTimeOk returns a tuple with the RestoreDateTime field value +// and a boolean to check if the value has been set. +func (o *TriggerDatabaseRestorePayload) GetRestoreDateTimeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RestoreDateTime, true +} + +// SetRestoreDateTime sets field value +func (o *TriggerDatabaseRestorePayload) SetRestoreDateTime(v string) { + o.RestoreDateTime = v +} + +func (o TriggerDatabaseRestorePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TriggerDatabaseRestorePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["restoreDateTime"] = o.RestoreDateTime + return toSerialize, nil +} + +func (o *TriggerDatabaseRestorePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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", + "restoreDateTime", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTriggerDatabaseRestorePayload := _TriggerDatabaseRestorePayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varTriggerDatabaseRestorePayload) + + if err != nil { + return err + } + + *o = TriggerDatabaseRestorePayload(varTriggerDatabaseRestorePayload) + + return err +} + +type NullableTriggerDatabaseRestorePayload struct { + value *TriggerDatabaseRestorePayload + isSet bool +} + +func (v NullableTriggerDatabaseRestorePayload) Get() *TriggerDatabaseRestorePayload { + return v.value +} + +func (v *NullableTriggerDatabaseRestorePayload) Set(val *TriggerDatabaseRestorePayload) { + v.value = val + v.isSet = true +} + +func (v NullableTriggerDatabaseRestorePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableTriggerDatabaseRestorePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTriggerDatabaseRestorePayload(val *TriggerDatabaseRestorePayload) *NullableTriggerDatabaseRestorePayload { + return &NullableTriggerDatabaseRestorePayload{value: val, isSet: true} +} + +func (v NullableTriggerDatabaseRestorePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTriggerDatabaseRestorePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_type.go b/services/sqlserverflex/v2api/model_type.go new file mode 100644 index 000000000..52709a61f --- /dev/null +++ b/services/sqlserverflex/v2api/model_type.go @@ -0,0 +1,119 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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" + "fmt" +) + +// Type the model 'Type' +type Type string + +// List of Type +const ( + TYPE_NOT_FOUND Type = "NotFound" + TYPE_CREATE Type = "Create" + TYPE_READ Type = "Read" + TYPE_DELETE Type = "Delete" + TYPE_UPDATE Type = "Update" + TYPE_VALIDATION Type = "Validation" +) + +// All allowed values of Type enum +var AllowedTypeEnumValues = []Type{ + "NotFound", + "Create", + "Read", + "Delete", + "Update", + "Validation", +} + +func (v *Type) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := Type(value) + for _, existing := range AllowedTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid Type", value) +} + +// NewTypeFromValue returns a pointer to a valid Type +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewTypeFromValue(v string) (*Type, error) { + ev := Type(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for Type: valid values are %v", v, AllowedTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v Type) IsValid() bool { + for _, existing := range AllowedTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Type value +func (v Type) Ptr() *Type { + return &v +} + +type NullableType struct { + value *Type + isSet bool +} + +func (v NullableType) Get() *Type { + return v.value +} + +func (v *NullableType) Set(val *Type) { + v.value = val + v.isSet = true +} + +func (v NullableType) IsSet() bool { + return v.isSet +} + +func (v *NullableType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableType(val *Type) *NullableType { + return &NullableType{value: val, isSet: true} +} + +func (v NullableType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_update_instance_payload.go b/services/sqlserverflex/v2api/model_update_instance_payload.go new file mode 100644 index 000000000..31fc9d343 --- /dev/null +++ b/services/sqlserverflex/v2api/model_update_instance_payload.go @@ -0,0 +1,305 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 UpdateInstancePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateInstancePayload{} + +// UpdateInstancePayload struct for UpdateInstancePayload +type UpdateInstancePayload struct { + // ACL is the Access Control List defining the IP ranges allowed to connect to the database + Acl InstanceDocumentationACL `json:"acl"` + // Cronjob for the daily full backup if not provided a job will generated between 00:00 and 04:59 + BackupSchedule string `json:"backupSchedule"` + // Id of the selected flavor + FlavorId string `json:"flavorId"` + // Labels for the instance + Labels map[string]interface{} `json:"labels"` + // Name of the instance + Name string `json:"name"` + // Version of the MSSQL Server + Version string `json:"version"` +} + +type _UpdateInstancePayload UpdateInstancePayload + +// 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(acl InstanceDocumentationACL, backupSchedule string, flavorId string, labels map[string]interface{}, name string, version string) *UpdateInstancePayload { + this := UpdateInstancePayload{} + this.Acl = acl + this.BackupSchedule = backupSchedule + this.FlavorId = flavorId + this.Labels = labels + this.Name = name + this.Version = version + 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{} + var version string = "2022" + this.Version = version + return &this +} + +// GetAcl returns the Acl field value +func (o *UpdateInstancePayload) GetAcl() InstanceDocumentationACL { + if o == nil { + var ret InstanceDocumentationACL + 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 *UpdateInstancePayload) GetAclOk() (*InstanceDocumentationACL, bool) { + if o == nil { + return nil, false + } + return &o.Acl, true +} + +// SetAcl sets field value +func (o *UpdateInstancePayload) SetAcl(v InstanceDocumentationACL) { + o.Acl = v +} + +// GetBackupSchedule returns the BackupSchedule field value +func (o *UpdateInstancePayload) 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 *UpdateInstancePayload) GetBackupScheduleOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BackupSchedule, true +} + +// SetBackupSchedule sets field value +func (o *UpdateInstancePayload) SetBackupSchedule(v string) { + o.BackupSchedule = v +} + +// GetFlavorId returns the FlavorId field value +func (o *UpdateInstancePayload) 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 *UpdateInstancePayload) GetFlavorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FlavorId, true +} + +// SetFlavorId sets field value +func (o *UpdateInstancePayload) SetFlavorId(v string) { + o.FlavorId = v +} + +// GetLabels returns the Labels field value +func (o *UpdateInstancePayload) GetLabels() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value +// and a boolean to check if the value has been set. +func (o *UpdateInstancePayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// SetLabels sets field value +func (o *UpdateInstancePayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value +func (o *UpdateInstancePayload) 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 *UpdateInstancePayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *UpdateInstancePayload) SetName(v string) { + o.Name = v +} + +// GetVersion returns the Version field value +func (o *UpdateInstancePayload) 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 *UpdateInstancePayload) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +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{}{} + toSerialize["acl"] = o.Acl + toSerialize["backupSchedule"] = o.BackupSchedule + toSerialize["flavorId"] = o.FlavorId + toSerialize["labels"] = o.Labels + toSerialize["name"] = o.Name + toSerialize["version"] = o.Version + return toSerialize, nil +} + +func (o *UpdateInstancePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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", + "labels", + "name", + "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) + } + } + + varUpdateInstancePayload := _UpdateInstancePayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varUpdateInstancePayload) + + if err != nil { + return err + } + + *o = UpdateInstancePayload(varUpdateInstancePayload) + + return err +} + +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/sqlserverflex/v2api/model_update_instance_response.go b/services/sqlserverflex/v2api/model_update_instance_response.go new file mode 100644 index 000000000..fe33c8fef --- /dev/null +++ b/services/sqlserverflex/v2api/model_update_instance_response.go @@ -0,0 +1,125 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 UpdateInstanceResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateInstanceResponse{} + +// UpdateInstanceResponse struct for UpdateInstanceResponse +type UpdateInstanceResponse struct { + Item *Instance `json:"item,omitempty"` +} + +// NewUpdateInstanceResponse instantiates a new UpdateInstanceResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateInstanceResponse() *UpdateInstanceResponse { + this := UpdateInstanceResponse{} + return &this +} + +// NewUpdateInstanceResponseWithDefaults instantiates a new UpdateInstanceResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateInstanceResponseWithDefaults() *UpdateInstanceResponse { + this := UpdateInstanceResponse{} + return &this +} + +// GetItem returns the Item field value if set, zero value otherwise. +func (o *UpdateInstanceResponse) 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 *UpdateInstanceResponse) 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 *UpdateInstanceResponse) 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 *UpdateInstanceResponse) SetItem(v Instance) { + o.Item = &v +} + +func (o UpdateInstanceResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateInstanceResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Item) { + toSerialize["item"] = o.Item + } + return toSerialize, nil +} + +type NullableUpdateInstanceResponse struct { + value *UpdateInstanceResponse + isSet bool +} + +func (v NullableUpdateInstanceResponse) Get() *UpdateInstanceResponse { + return v.value +} + +func (v *NullableUpdateInstanceResponse) Set(val *UpdateInstanceResponse) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateInstanceResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateInstanceResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateInstanceResponse(val *UpdateInstanceResponse) *NullableUpdateInstanceResponse { + return &NullableUpdateInstanceResponse{value: val, isSet: true} +} + +func (v NullableUpdateInstanceResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateInstanceResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_user.go b/services/sqlserverflex/v2api/model_user.go new file mode 100644 index 000000000..0684cc924 --- /dev/null +++ b/services/sqlserverflex/v2api/model_user.go @@ -0,0 +1,377 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v2api/model_user_response_user.go b/services/sqlserverflex/v2api/model_user_response_user.go new file mode 100644 index 000000000..c331e83fa --- /dev/null +++ b/services/sqlserverflex/v2api/model_user_response_user.go @@ -0,0 +1,305 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 UserResponseUser type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserResponseUser{} + +// UserResponseUser struct for UserResponseUser +type UserResponseUser struct { + DefaultDatabase *string `json:"default_database,omitempty"` + 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"` +} + +// NewUserResponseUser instantiates a new UserResponseUser object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserResponseUser() *UserResponseUser { + this := UserResponseUser{} + return &this +} + +// NewUserResponseUserWithDefaults instantiates a new UserResponseUser object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserResponseUserWithDefaults() *UserResponseUser { + this := UserResponseUser{} + return &this +} + +// GetDefaultDatabase returns the DefaultDatabase field value if set, zero value otherwise. +func (o *UserResponseUser) GetDefaultDatabase() string { + if o == nil || IsNil(o.DefaultDatabase) { + var ret string + return ret + } + return *o.DefaultDatabase +} + +// GetDefaultDatabaseOk returns a tuple with the DefaultDatabase field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserResponseUser) GetDefaultDatabaseOk() (*string, bool) { + if o == nil || IsNil(o.DefaultDatabase) { + return nil, false + } + return o.DefaultDatabase, true +} + +// HasDefaultDatabase returns a boolean if a field has been set. +func (o *UserResponseUser) HasDefaultDatabase() bool { + if o != nil && !IsNil(o.DefaultDatabase) { + return true + } + + return false +} + +// SetDefaultDatabase gets a reference to the given string and assigns it to the DefaultDatabase field. +func (o *UserResponseUser) SetDefaultDatabase(v string) { + o.DefaultDatabase = &v +} + +// GetHost returns the Host field value if set, zero value otherwise. +func (o *UserResponseUser) 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 *UserResponseUser) 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 *UserResponseUser) 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 *UserResponseUser) SetHost(v string) { + o.Host = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *UserResponseUser) 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 *UserResponseUser) 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 *UserResponseUser) 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 *UserResponseUser) SetId(v string) { + o.Id = &v +} + +// GetPort returns the Port field value if set, zero value otherwise. +func (o *UserResponseUser) 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 *UserResponseUser) 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 *UserResponseUser) 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 *UserResponseUser) SetPort(v int64) { + o.Port = &v +} + +// GetRoles returns the Roles field value if set, zero value otherwise. +func (o *UserResponseUser) 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 *UserResponseUser) 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 *UserResponseUser) 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 *UserResponseUser) SetRoles(v []string) { + o.Roles = v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *UserResponseUser) 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 *UserResponseUser) 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 *UserResponseUser) 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 *UserResponseUser) SetUsername(v string) { + o.Username = &v +} + +func (o UserResponseUser) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserResponseUser) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DefaultDatabase) { + toSerialize["default_database"] = o.DefaultDatabase + } + 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 NullableUserResponseUser struct { + value *UserResponseUser + isSet bool +} + +func (v NullableUserResponseUser) Get() *UserResponseUser { + return v.value +} + +func (v *NullableUserResponseUser) Set(val *UserResponseUser) { + v.value = val + v.isSet = true +} + +func (v NullableUserResponseUser) IsSet() bool { + return v.isSet +} + +func (v *NullableUserResponseUser) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserResponseUser(val *UserResponseUser) *NullableUserResponseUser { + return &NullableUserResponseUser{value: val, isSet: true} +} + +func (v NullableUserResponseUser) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserResponseUser) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/response.go b/services/sqlserverflex/v2api/response.go new file mode 100644 index 000000000..4944a8473 --- /dev/null +++ b/services/sqlserverflex/v2api/response.go @@ -0,0 +1,48 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v2api/utils.go b/services/sqlserverflex/v2api/utils.go new file mode 100644 index 000000000..6d92a2cc0 --- /dev/null +++ b/services/sqlserverflex/v2api/utils.go @@ -0,0 +1,362 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v3alpha1api/api_default.go b/services/sqlserverflex/v3alpha1api/api_default.go new file mode 100644 index 000000000..e814aa586 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/api_default.go @@ -0,0 +1,6083 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 { + + /* + 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, *http.Response, error) + + /* + CreateInstanceRequest Create Instance + + Create a new instance of a sqlserver 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, *http.Response, 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, *http.Response, 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 databaseName The name of the database. + @return ApiDeleteDatabaseRequestRequest + */ + DeleteDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiDeleteDatabaseRequestRequest + + // DeleteDatabaseRequestExecute executes the request + DeleteDatabaseRequestExecute(r ApiDeleteDatabaseRequestRequest) (*http.Response, error) + + /* + DeleteInstanceRequest Delete Instance + + Delete an available sqlserver 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) (*http.Response, 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 int64) ApiDeleteUserRequestRequest + + // DeleteUserRequestExecute executes the request + DeleteUserRequestExecute(r ApiDeleteUserRequestRequest) (*http.Response, 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 int64) ApiGetBackupRequestRequest + + // GetBackupRequestExecute executes the request + // @return GetBackupResponse + GetBackupRequestExecute(r ApiGetBackupRequestRequest) (*GetBackupResponse, *http.Response, error) + + /* + GetCollationsRequest Get database collation list + + Returns a list of 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, *http.Response, error) + + /* + GetDatabaseRequest Get Database + + Get specific available 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. + @param databaseName The name of the database. + @return ApiGetDatabaseRequestRequest + */ + GetDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiGetDatabaseRequestRequest + + // GetDatabaseRequestExecute executes the request + // @return GetDatabaseResponse + GetDatabaseRequestExecute(r ApiGetDatabaseRequestRequest) (*GetDatabaseResponse, *http.Response, 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, *http.Response, 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, *http.Response, error) + + /* + GetStoragesRequest 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 The STACKIT project ID. + @param region The region which should be addressed + @param flavorId The id of an instance flavor. + @return ApiGetStoragesRequestRequest + */ + GetStoragesRequest(ctx context.Context, projectId string, region string, flavorId string) ApiGetStoragesRequestRequest + + // GetStoragesRequestExecute executes the request + // @return GetStoragesResponse + GetStoragesRequestExecute(r ApiGetStoragesRequestRequest) (*GetStoragesResponse, *http.Response, 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 int64) ApiGetUserRequestRequest + + // GetUserRequestExecute executes the request + // @return GetUserResponse + GetUserRequestExecute(r ApiGetUserRequestRequest) (*GetUserResponse, *http.Response, error) + + /* + GetVersionsRequest Get Versions + + Get the sqlserver available 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, *http.Response, 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, *http.Response, error) + + /* + ListCompatibilitiesRequest Get database compatibility list + + Returns a list of compatibility levels for creating a new 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 ApiListCompatibilitiesRequestRequest + */ + ListCompatibilitiesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListCompatibilitiesRequestRequest + + // ListCompatibilitiesRequestExecute executes the request + // @return ListCompatibilityResponse + ListCompatibilitiesRequestExecute(r ApiListCompatibilitiesRequestRequest) (*ListCompatibilityResponse, *http.Response, error) + + /* + ListCurrentRunningRestoreJobs List current running restore jobs + + List all currently running restore jobs 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 ApiListCurrentRunningRestoreJobsRequest + */ + ListCurrentRunningRestoreJobs(ctx context.Context, projectId string, region string, instanceId string) ApiListCurrentRunningRestoreJobsRequest + + // ListCurrentRunningRestoreJobsExecute executes the request + // @return ListCurrentRunningRestoreJobs + ListCurrentRunningRestoreJobsExecute(r ApiListCurrentRunningRestoreJobsRequest) (*ListCurrentRunningRestoreJobs, *http.Response, 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, *http.Response, 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, *http.Response, error) + + /* + ListRolesRequest List Roles + + List available roles for an instance that can be assigned to a user + + @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, *http.Response, 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, *http.Response, 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, *http.Response, 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 int64) ApiResetUserRequestRequest + + // ResetUserRequestExecute executes the request + // @return ResetUserResponse + ResetUserRequestExecute(r ApiResetUserRequestRequest) (*ResetUserResponse, *http.Response, error) + + /* + RestoreDatabaseFromBackup Create a Restore Operation + + Triggers a new restore operation for the specified instance. + The request body defines the source + (e.g., internal backup, external S3) and the target 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 ApiRestoreDatabaseFromBackupRequest + */ + RestoreDatabaseFromBackup(ctx context.Context, projectId string, region string, instanceId string) ApiRestoreDatabaseFromBackupRequest + + // RestoreDatabaseFromBackupExecute executes the request + RestoreDatabaseFromBackupExecute(r ApiRestoreDatabaseFromBackupRequest) (*http.Response, error) + + /* + TriggerBackupRequest Trigger backup for a specific Database + + Trigger backup for a specific 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. + @param databaseName The name of the database. + @return ApiTriggerBackupRequestRequest + */ + TriggerBackupRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiTriggerBackupRequestRequest + + // TriggerBackupRequestExecute executes the request + TriggerBackupRequestExecute(r ApiTriggerBackupRequestRequest) (*http.Response, error) + + /* + TriggerRestoreRequest Trigger restore for a specific Database + + Trigger restore for a specific 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. + @param databaseName The name of the database. + @return ApiTriggerRestoreRequestRequest + */ + TriggerRestoreRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiTriggerRestoreRequestRequest + + // TriggerRestoreRequestExecute executes the request + TriggerRestoreRequestExecute(r ApiTriggerRestoreRequestRequest) (*http.Response, error) + + /* + UpdateInstancePartiallyRequest Update Instance Partially + + Update an available instance of a mssql database. No fields are required. + + **Please note that any changes applied via PUT or PATCH requests will initiate a reboot of the SQL Server Flex 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 ApiUpdateInstancePartiallyRequestRequest + */ + UpdateInstancePartiallyRequest(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstancePartiallyRequestRequest + + // UpdateInstancePartiallyRequestExecute executes the request + UpdateInstancePartiallyRequestExecute(r ApiUpdateInstancePartiallyRequestRequest) (*http.Response, error) + + /* + UpdateInstanceRequest Update Instance + + Updates an available instance of a sqlserver database + + **Please note that any changes applied via PUT or PATCH requests will initiate a reboot of the SQL Server Flex 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 ApiUpdateInstanceRequestRequest + */ + UpdateInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceRequestRequest + + // UpdateInstanceRequestExecute executes the request + UpdateInstanceRequestExecute(r ApiUpdateInstanceRequestRequest) (*http.Response, error) +} + +// DefaultAPIService DefaultAPI service +type DefaultAPIService service + +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, *http.Response, 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, *http.Response, 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, nil, &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, nil, 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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, 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, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, 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, *http.Response, error) { + return r.ApiService.CreateInstanceRequestExecute(r) +} + +/* +CreateInstanceRequest Create Instance + +Create a new instance of a sqlserver 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, *http.Response, 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, nil, &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, nil, 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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, 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, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, 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, *http.Response, 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, *http.Response, 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, nil, &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, nil, 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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, 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, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, 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, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeleteDatabaseRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + databaseName string +} + +func (r ApiDeleteDatabaseRequestRequest) Execute() (*http.Response, 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 databaseName The name of the database. + @return ApiDeleteDatabaseRequestRequest +*/ +func (a *DefaultAPIService) DeleteDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiDeleteDatabaseRequestRequest { + return ApiDeleteDatabaseRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + databaseName: databaseName, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteDatabaseRequestExecute(r ApiDeleteDatabaseRequestRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteDatabaseRequest") + if err != nil { + return nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/databases/{databaseName}" + 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, "{"+"databaseName"+"}", url.PathEscape(parameterValueToString(r.databaseName, "databaseName")), -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 nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDeleteInstanceRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string +} + +func (r ApiDeleteInstanceRequestRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteInstanceRequestExecute(r) +} + +/* +DeleteInstanceRequest Delete Instance + +Delete an available sqlserver 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) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteInstanceRequest") + if err != nil { + return nil, &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 nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDeleteUserRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + userId int64 +} + +func (r ApiDeleteUserRequestRequest) Execute() (*http.Response, 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 int64) 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) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteUserRequest") + if err != nil { + return nil, &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 nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiGetBackupRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + backupId int64 +} + +func (r ApiGetBackupRequestRequest) Execute() (*GetBackupResponse, *http.Response, 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 int64) 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, *http.Response, 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, nil, &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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, 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, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetCollationsRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string +} + +func (r ApiGetCollationsRequestRequest) Execute() (*GetCollationsResponse, *http.Response, error) { + return r.ApiService.GetCollationsRequestExecute(r) +} + +/* +GetCollationsRequest Get database collation list + +Returns a list of 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, *http.Response, 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, nil, &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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, 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, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetDatabaseRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + databaseName string +} + +func (r ApiGetDatabaseRequestRequest) Execute() (*GetDatabaseResponse, *http.Response, error) { + return r.ApiService.GetDatabaseRequestExecute(r) +} + +/* +GetDatabaseRequest Get Database + +Get specific available 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. + @param databaseName The name of the database. + @return ApiGetDatabaseRequestRequest +*/ +func (a *DefaultAPIService) GetDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiGetDatabaseRequestRequest { + return ApiGetDatabaseRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + databaseName: databaseName, + } +} + +// Execute executes the request +// +// @return GetDatabaseResponse +func (a *DefaultAPIService) GetDatabaseRequestExecute(r ApiGetDatabaseRequestRequest) (*GetDatabaseResponse, *http.Response, 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, nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/databases/{databaseName}" + 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, "{"+"databaseName"+"}", url.PathEscape(parameterValueToString(r.databaseName, "databaseName")), -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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, 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, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetFlavorsRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + page *int64 + size *int64 + sort *FlavorSort +} + +// Number of the page of items list to be returned. +func (r ApiGetFlavorsRequestRequest) Page(page int64) ApiGetFlavorsRequestRequest { + r.page = &page + return r +} + +// Number of items to be returned on each page. +func (r ApiGetFlavorsRequestRequest) Size(size int64) 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, *http.Response, 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, *http.Response, 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, nil, &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 int64 = 1 + parameterAddToHeaderOrQuery(localVarQueryParams, "page", defaultValue, "form", "") + r.page = &defaultValue + } + if r.size != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "form", "") + } else { + var defaultValue int64 = 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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, 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, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetInstanceRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string +} + +func (r ApiGetInstanceRequestRequest) Execute() (*GetInstanceResponse, *http.Response, 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, *http.Response, 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, nil, &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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetStoragesRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + flavorId string +} + +func (r ApiGetStoragesRequestRequest) Execute() (*GetStoragesResponse, *http.Response, error) { + return r.ApiService.GetStoragesRequestExecute(r) +} + +/* +GetStoragesRequest 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 The STACKIT project ID. + @param region The region which should be addressed + @param flavorId The id of an instance flavor. + @return ApiGetStoragesRequestRequest +*/ +func (a *DefaultAPIService) GetStoragesRequest(ctx context.Context, projectId string, region string, flavorId string) ApiGetStoragesRequestRequest { + return ApiGetStoragesRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + flavorId: flavorId, + } +} + +// Execute executes the request +// +// @return GetStoragesResponse +func (a *DefaultAPIService) GetStoragesRequestExecute(r ApiGetStoragesRequestRequest) (*GetStoragesResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetStoragesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetStoragesRequest") + if err != nil { + return localVarReturnValue, nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3alpha1/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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetUserRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + userId int64 +} + +func (r ApiGetUserRequestRequest) Execute() (*GetUserResponse, *http.Response, 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 int64) 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, *http.Response, 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, nil, &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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetVersionsRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string +} + +func (r ApiGetVersionsRequestRequest) Execute() (*GetVersionsResponse, *http.Response, error) { + return r.ApiService.GetVersionsRequestExecute(r) +} + +/* +GetVersionsRequest Get Versions + +Get the sqlserver available 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, *http.Response, 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, nil, &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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, 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, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListBackupsRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + page *int64 + size *int64 + sort *BackupSort +} + +// Number of the page of items list to be returned. +func (r ApiListBackupsRequestRequest) Page(page int64) ApiListBackupsRequestRequest { + r.page = &page + return r +} + +// Number of items to be returned on each page. +func (r ApiListBackupsRequestRequest) Size(size int64) 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, *http.Response, 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, *http.Response, 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, nil, &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 int64 = 1 + parameterAddToHeaderOrQuery(localVarQueryParams, "page", defaultValue, "form", "") + r.page = &defaultValue + } + if r.size != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "form", "") + } else { + var defaultValue int64 = 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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, 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, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListCompatibilitiesRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string +} + +func (r ApiListCompatibilitiesRequestRequest) Execute() (*ListCompatibilityResponse, *http.Response, error) { + return r.ApiService.ListCompatibilitiesRequestExecute(r) +} + +/* +ListCompatibilitiesRequest Get database compatibility list + +Returns a list of compatibility levels for creating a new 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 ApiListCompatibilitiesRequestRequest +*/ +func (a *DefaultAPIService) ListCompatibilitiesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListCompatibilitiesRequestRequest { + return ApiListCompatibilitiesRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListCompatibilityResponse +func (a *DefaultAPIService) ListCompatibilitiesRequestExecute(r ApiListCompatibilitiesRequestRequest) (*ListCompatibilityResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListCompatibilityResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListCompatibilitiesRequest") + if err != nil { + return localVarReturnValue, nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/compatibility" + 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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, 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, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListCurrentRunningRestoreJobsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string +} + +func (r ApiListCurrentRunningRestoreJobsRequest) Execute() (*ListCurrentRunningRestoreJobs, *http.Response, error) { + return r.ApiService.ListCurrentRunningRestoreJobsExecute(r) +} + +/* +ListCurrentRunningRestoreJobs List current running restore jobs + +List all currently running restore jobs 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 ApiListCurrentRunningRestoreJobsRequest +*/ +func (a *DefaultAPIService) ListCurrentRunningRestoreJobs(ctx context.Context, projectId string, region string, instanceId string) ApiListCurrentRunningRestoreJobsRequest { + return ApiListCurrentRunningRestoreJobsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListCurrentRunningRestoreJobs +func (a *DefaultAPIService) ListCurrentRunningRestoreJobsExecute(r ApiListCurrentRunningRestoreJobsRequest) (*ListCurrentRunningRestoreJobs, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListCurrentRunningRestoreJobs + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListCurrentRunningRestoreJobs") + if err != nil { + return localVarReturnValue, nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/restore-jobs" + 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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, 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, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListDatabasesRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + page *int64 + size *int64 + sort *DatabaseSort +} + +// Number of the page of items list to be returned. +func (r ApiListDatabasesRequestRequest) Page(page int64) ApiListDatabasesRequestRequest { + r.page = &page + return r +} + +// Number of items to be returned on each page. +func (r ApiListDatabasesRequestRequest) Size(size int64) 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, *http.Response, 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, *http.Response, 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, nil, &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 int64 = 1 + parameterAddToHeaderOrQuery(localVarQueryParams, "page", defaultValue, "form", "") + r.page = &defaultValue + } + if r.size != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "form", "") + } else { + var defaultValue int64 = 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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListInstancesRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + page *int64 + size *int64 + sort *InstanceSort +} + +// Number of the page of items list to be returned. +func (r ApiListInstancesRequestRequest) Page(page int64) ApiListInstancesRequestRequest { + r.page = &page + return r +} + +// Number of items to be returned on each page. +func (r ApiListInstancesRequestRequest) Size(size int64) 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, *http.Response, 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, *http.Response, 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, nil, &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 int64 = 1 + parameterAddToHeaderOrQuery(localVarQueryParams, "page", defaultValue, "form", "") + r.page = &defaultValue + } + if r.size != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "form", "") + } else { + var defaultValue int64 = 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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListRolesRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string +} + +func (r ApiListRolesRequestRequest) Execute() (*ListRolesResponse, *http.Response, error) { + return r.ApiService.ListRolesRequestExecute(r) +} + +/* +ListRolesRequest List Roles + +List available roles for an instance that can be assigned to a user + + @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, *http.Response, 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, nil, &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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, 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, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListUsersRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + page *int64 + size *int64 + sort *UserSort +} + +// Number of the page of items list to be returned. +func (r ApiListUsersRequestRequest) Page(page int64) ApiListUsersRequestRequest { + r.page = &page + return r +} + +// Number of items to be returned on each page. +func (r ApiListUsersRequestRequest) Size(size int64) 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, *http.Response, 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, *http.Response, 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, nil, &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 int64 = 1 + parameterAddToHeaderOrQuery(localVarQueryParams, "page", defaultValue, "form", "") + r.page = &defaultValue + } + if r.size != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "form", "") + } else { + var defaultValue int64 = 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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, 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, *http.Response, 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, *http.Response, 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, nil, &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, nil, 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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, 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, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, 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, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiResetUserRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + userId int64 +} + +func (r ApiResetUserRequestRequest) Execute() (*ResetUserResponse, *http.Response, 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 int64) 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, *http.Response, 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, nil, &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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, 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, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRestoreDatabaseFromBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + restoreDatabaseFromBackupPayload *RestoreDatabaseFromBackupPayload +} + +// The restore operation payload. +func (r ApiRestoreDatabaseFromBackupRequest) RestoreDatabaseFromBackupPayload(restoreDatabaseFromBackupPayload RestoreDatabaseFromBackupPayload) ApiRestoreDatabaseFromBackupRequest { + r.restoreDatabaseFromBackupPayload = &restoreDatabaseFromBackupPayload + return r +} + +func (r ApiRestoreDatabaseFromBackupRequest) Execute() (*http.Response, error) { + return r.ApiService.RestoreDatabaseFromBackupExecute(r) +} + +/* +RestoreDatabaseFromBackup Create a Restore Operation + +Triggers a new restore operation for the specified instance. +The request body defines the source +(e.g., internal backup, external S3) and the target 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 ApiRestoreDatabaseFromBackupRequest +*/ +func (a *DefaultAPIService) RestoreDatabaseFromBackup(ctx context.Context, projectId string, region string, instanceId string) ApiRestoreDatabaseFromBackupRequest { + return ApiRestoreDatabaseFromBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) RestoreDatabaseFromBackupExecute(r ApiRestoreDatabaseFromBackupRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.RestoreDatabaseFromBackup") + if err != nil { + return nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/restores" + 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.restoreDatabaseFromBackupPayload == nil { + return nil, reportError("restoreDatabaseFromBackupPayload 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.restoreDatabaseFromBackupPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, 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 localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiTriggerBackupRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + databaseName string +} + +func (r ApiTriggerBackupRequestRequest) Execute() (*http.Response, error) { + return r.ApiService.TriggerBackupRequestExecute(r) +} + +/* +TriggerBackupRequest Trigger backup for a specific Database + +Trigger backup for a specific 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. + @param databaseName The name of the database. + @return ApiTriggerBackupRequestRequest +*/ +func (a *DefaultAPIService) TriggerBackupRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiTriggerBackupRequestRequest { + return ApiTriggerBackupRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + databaseName: databaseName, + } +} + +// Execute executes the request +func (a *DefaultAPIService) TriggerBackupRequestExecute(r ApiTriggerBackupRequestRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.TriggerBackupRequest") + if err != nil { + return nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/backups/databases/{databaseName}" + 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, "{"+"databaseName"+"}", url.PathEscape(parameterValueToString(r.databaseName, "databaseName")), -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 nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, 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 localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, 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 localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiTriggerRestoreRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + databaseName string + triggerRestoreRequestPayload *TriggerRestoreRequestPayload +} + +// The request body with the parameters for the database restore. +func (r ApiTriggerRestoreRequestRequest) TriggerRestoreRequestPayload(triggerRestoreRequestPayload TriggerRestoreRequestPayload) ApiTriggerRestoreRequestRequest { + r.triggerRestoreRequestPayload = &triggerRestoreRequestPayload + return r +} + +func (r ApiTriggerRestoreRequestRequest) Execute() (*http.Response, error) { + return r.ApiService.TriggerRestoreRequestExecute(r) +} + +/* +TriggerRestoreRequest Trigger restore for a specific Database + +Trigger restore for a specific 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. + @param databaseName The name of the database. + @return ApiTriggerRestoreRequestRequest +*/ +func (a *DefaultAPIService) TriggerRestoreRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiTriggerRestoreRequestRequest { + return ApiTriggerRestoreRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + databaseName: databaseName, + } +} + +// Execute executes the request +func (a *DefaultAPIService) TriggerRestoreRequestExecute(r ApiTriggerRestoreRequestRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.TriggerRestoreRequest") + if err != nil { + return nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/backups/databases/{databaseName}/restores" + 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, "{"+"databaseName"+"}", url.PathEscape(parameterValueToString(r.databaseName, "databaseName")), -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.triggerRestoreRequestPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, 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 localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, 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 localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, 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() (*http.Response, error) { + return r.ApiService.UpdateInstancePartiallyRequestExecute(r) +} + +/* +UpdateInstancePartiallyRequest Update Instance Partially + +Update an available instance of a mssql database. No fields are required. + +**Please note that any changes applied via PUT or PATCH requests will initiate a reboot of the SQL Server Flex 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 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) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateInstancePartiallyRequest") + if err != nil { + return nil, &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 nil, 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 nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, 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 localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, 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() (*http.Response, error) { + return r.ApiService.UpdateInstanceRequestExecute(r) +} + +/* +UpdateInstanceRequest Update Instance + +# Updates an available instance of a sqlserver database + +**Please note that any changes applied via PUT or PATCH requests will initiate a reboot of the SQL Server Flex 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 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) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateInstanceRequest") + if err != nil { + return nil, &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 nil, 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 nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, 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 localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} diff --git a/services/sqlserverflex/v3alpha1api/api_default_mock.go b/services/sqlserverflex/v3alpha1api/api_default_mock.go new file mode 100644 index 000000000..f46a2fbdf --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/api_default_mock.go @@ -0,0 +1,637 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "context" + "net/http" +) + +// 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 { + // CreateDatabaseRequestExecuteMock can be populated to implement the behavior of the CreateDatabaseRequestExecute function of this mock + CreateDatabaseRequestExecuteMock *func(r ApiCreateDatabaseRequestRequest) (*CreateDatabaseResponse, *http.Response, error) + // CreateInstanceRequestExecuteMock can be populated to implement the behavior of the CreateInstanceRequestExecute function of this mock + CreateInstanceRequestExecuteMock *func(r ApiCreateInstanceRequestRequest) (*CreateInstanceResponse, *http.Response, error) + // CreateUserRequestExecuteMock can be populated to implement the behavior of the CreateUserRequestExecute function of this mock + CreateUserRequestExecuteMock *func(r ApiCreateUserRequestRequest) (*CreateUserResponse, *http.Response, error) + // DeleteDatabaseRequestExecuteMock can be populated to implement the behavior of the DeleteDatabaseRequestExecute function of this mock + DeleteDatabaseRequestExecuteMock *func(r ApiDeleteDatabaseRequestRequest) (*http.Response, error) + // DeleteInstanceRequestExecuteMock can be populated to implement the behavior of the DeleteInstanceRequestExecute function of this mock + DeleteInstanceRequestExecuteMock *func(r ApiDeleteInstanceRequestRequest) (*http.Response, error) + // DeleteUserRequestExecuteMock can be populated to implement the behavior of the DeleteUserRequestExecute function of this mock + DeleteUserRequestExecuteMock *func(r ApiDeleteUserRequestRequest) (*http.Response, error) + // GetBackupRequestExecuteMock can be populated to implement the behavior of the GetBackupRequestExecute function of this mock + GetBackupRequestExecuteMock *func(r ApiGetBackupRequestRequest) (*GetBackupResponse, *http.Response, error) + // GetCollationsRequestExecuteMock can be populated to implement the behavior of the GetCollationsRequestExecute function of this mock + GetCollationsRequestExecuteMock *func(r ApiGetCollationsRequestRequest) (*GetCollationsResponse, *http.Response, error) + // GetDatabaseRequestExecuteMock can be populated to implement the behavior of the GetDatabaseRequestExecute function of this mock + GetDatabaseRequestExecuteMock *func(r ApiGetDatabaseRequestRequest) (*GetDatabaseResponse, *http.Response, error) + // GetFlavorsRequestExecuteMock can be populated to implement the behavior of the GetFlavorsRequestExecute function of this mock + GetFlavorsRequestExecuteMock *func(r ApiGetFlavorsRequestRequest) (*GetFlavorsResponse, *http.Response, error) + // GetInstanceRequestExecuteMock can be populated to implement the behavior of the GetInstanceRequestExecute function of this mock + GetInstanceRequestExecuteMock *func(r ApiGetInstanceRequestRequest) (*GetInstanceResponse, *http.Response, error) + // GetStoragesRequestExecuteMock can be populated to implement the behavior of the GetStoragesRequestExecute function of this mock + GetStoragesRequestExecuteMock *func(r ApiGetStoragesRequestRequest) (*GetStoragesResponse, *http.Response, error) + // GetUserRequestExecuteMock can be populated to implement the behavior of the GetUserRequestExecute function of this mock + GetUserRequestExecuteMock *func(r ApiGetUserRequestRequest) (*GetUserResponse, *http.Response, error) + // GetVersionsRequestExecuteMock can be populated to implement the behavior of the GetVersionsRequestExecute function of this mock + GetVersionsRequestExecuteMock *func(r ApiGetVersionsRequestRequest) (*GetVersionsResponse, *http.Response, error) + // ListBackupsRequestExecuteMock can be populated to implement the behavior of the ListBackupsRequestExecute function of this mock + ListBackupsRequestExecuteMock *func(r ApiListBackupsRequestRequest) (*ListBackupResponse, *http.Response, error) + // ListCompatibilitiesRequestExecuteMock can be populated to implement the behavior of the ListCompatibilitiesRequestExecute function of this mock + ListCompatibilitiesRequestExecuteMock *func(r ApiListCompatibilitiesRequestRequest) (*ListCompatibilityResponse, *http.Response, error) + // ListCurrentRunningRestoreJobsExecuteMock can be populated to implement the behavior of the ListCurrentRunningRestoreJobsExecute function of this mock + ListCurrentRunningRestoreJobsExecuteMock *func(r ApiListCurrentRunningRestoreJobsRequest) (*ListCurrentRunningRestoreJobs, *http.Response, error) + // ListDatabasesRequestExecuteMock can be populated to implement the behavior of the ListDatabasesRequestExecute function of this mock + ListDatabasesRequestExecuteMock *func(r ApiListDatabasesRequestRequest) (*ListDatabasesResponse, *http.Response, error) + // ListInstancesRequestExecuteMock can be populated to implement the behavior of the ListInstancesRequestExecute function of this mock + ListInstancesRequestExecuteMock *func(r ApiListInstancesRequestRequest) (*ListInstancesResponse, *http.Response, error) + // ListRolesRequestExecuteMock can be populated to implement the behavior of the ListRolesRequestExecute function of this mock + ListRolesRequestExecuteMock *func(r ApiListRolesRequestRequest) (*ListRolesResponse, *http.Response, error) + // ListUsersRequestExecuteMock can be populated to implement the behavior of the ListUsersRequestExecute function of this mock + ListUsersRequestExecuteMock *func(r ApiListUsersRequestRequest) (*ListUserResponse, *http.Response, error) + // ProtectInstanceRequestExecuteMock can be populated to implement the behavior of the ProtectInstanceRequestExecute function of this mock + ProtectInstanceRequestExecuteMock *func(r ApiProtectInstanceRequestRequest) (*ProtectInstanceResponse, *http.Response, error) + // ResetUserRequestExecuteMock can be populated to implement the behavior of the ResetUserRequestExecute function of this mock + ResetUserRequestExecuteMock *func(r ApiResetUserRequestRequest) (*ResetUserResponse, *http.Response, error) + // RestoreDatabaseFromBackupExecuteMock can be populated to implement the behavior of the RestoreDatabaseFromBackupExecute function of this mock + RestoreDatabaseFromBackupExecuteMock *func(r ApiRestoreDatabaseFromBackupRequest) (*http.Response, error) + // TriggerBackupRequestExecuteMock can be populated to implement the behavior of the TriggerBackupRequestExecute function of this mock + TriggerBackupRequestExecuteMock *func(r ApiTriggerBackupRequestRequest) (*http.Response, error) + // TriggerRestoreRequestExecuteMock can be populated to implement the behavior of the TriggerRestoreRequestExecute function of this mock + TriggerRestoreRequestExecuteMock *func(r ApiTriggerRestoreRequestRequest) (*http.Response, error) + // UpdateInstancePartiallyRequestExecuteMock can be populated to implement the behavior of the UpdateInstancePartiallyRequestExecute function of this mock + UpdateInstancePartiallyRequestExecuteMock *func(r ApiUpdateInstancePartiallyRequestRequest) (*http.Response, error) + // UpdateInstanceRequestExecuteMock can be populated to implement the behavior of the UpdateInstanceRequestExecute function of this mock + UpdateInstanceRequestExecuteMock *func(r ApiUpdateInstanceRequestRequest) (*http.Response, error) +} + +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, *http.Response, error) { + if a.CreateDatabaseRequestExecuteMock == nil { + var localVarReturnValue *CreateDatabaseResponse + return localVarReturnValue, &http.Response{}, 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, *http.Response, error) { + if a.CreateInstanceRequestExecuteMock == nil { + var localVarReturnValue *CreateInstanceResponse + return localVarReturnValue, &http.Response{}, 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, *http.Response, error) { + if a.CreateUserRequestExecuteMock == nil { + var localVarReturnValue *CreateUserResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.CreateUserRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiDeleteDatabaseRequestRequest { + return ApiDeleteDatabaseRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + databaseName: databaseName, + } +} + +// 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) (*http.Response, error) { + if a.DeleteDatabaseRequestExecuteMock == nil { + return &http.Response{}, 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) (*http.Response, error) { + if a.DeleteInstanceRequestExecuteMock == nil { + return &http.Response{}, nil + } + + return (*a.DeleteInstanceRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int64) 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) (*http.Response, error) { + if a.DeleteUserRequestExecuteMock == nil { + return &http.Response{}, nil + } + + return (*a.DeleteUserRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetBackupRequest(ctx context.Context, projectId string, region string, instanceId string, backupId int64) 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, *http.Response, error) { + if a.GetBackupRequestExecuteMock == nil { + var localVarReturnValue *GetBackupResponse + return localVarReturnValue, &http.Response{}, 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, *http.Response, error) { + if a.GetCollationsRequestExecuteMock == nil { + var localVarReturnValue *GetCollationsResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.GetCollationsRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiGetDatabaseRequestRequest { + return ApiGetDatabaseRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + databaseName: databaseName, + } +} + +// 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, *http.Response, error) { + if a.GetDatabaseRequestExecuteMock == nil { + var localVarReturnValue *GetDatabaseResponse + return localVarReturnValue, &http.Response{}, 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, *http.Response, error) { + if a.GetFlavorsRequestExecuteMock == nil { + var localVarReturnValue *GetFlavorsResponse + return localVarReturnValue, &http.Response{}, 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, *http.Response, error) { + if a.GetInstanceRequestExecuteMock == nil { + var localVarReturnValue *GetInstanceResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.GetInstanceRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetStoragesRequest(ctx context.Context, projectId string, region string, flavorId string) ApiGetStoragesRequestRequest { + return ApiGetStoragesRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + flavorId: flavorId, + } +} + +// GetStoragesRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetStoragesRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetStoragesRequestExecute(r ApiGetStoragesRequestRequest) (*GetStoragesResponse, *http.Response, error) { + if a.GetStoragesRequestExecuteMock == nil { + var localVarReturnValue *GetStoragesResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.GetStoragesRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int64) 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, *http.Response, error) { + if a.GetUserRequestExecuteMock == nil { + var localVarReturnValue *GetUserResponse + return localVarReturnValue, &http.Response{}, 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, *http.Response, error) { + if a.GetVersionsRequestExecuteMock == nil { + var localVarReturnValue *GetVersionsResponse + return localVarReturnValue, &http.Response{}, 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, *http.Response, error) { + if a.ListBackupsRequestExecuteMock == nil { + var localVarReturnValue *ListBackupResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.ListBackupsRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListCompatibilitiesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListCompatibilitiesRequestRequest { + return ApiListCompatibilitiesRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// ListCompatibilitiesRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListCompatibilitiesRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListCompatibilitiesRequestExecute(r ApiListCompatibilitiesRequestRequest) (*ListCompatibilityResponse, *http.Response, error) { + if a.ListCompatibilitiesRequestExecuteMock == nil { + var localVarReturnValue *ListCompatibilityResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.ListCompatibilitiesRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListCurrentRunningRestoreJobs(ctx context.Context, projectId string, region string, instanceId string) ApiListCurrentRunningRestoreJobsRequest { + return ApiListCurrentRunningRestoreJobsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// ListCurrentRunningRestoreJobsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListCurrentRunningRestoreJobsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListCurrentRunningRestoreJobsExecute(r ApiListCurrentRunningRestoreJobsRequest) (*ListCurrentRunningRestoreJobs, *http.Response, error) { + if a.ListCurrentRunningRestoreJobsExecuteMock == nil { + var localVarReturnValue *ListCurrentRunningRestoreJobs + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.ListCurrentRunningRestoreJobsExecuteMock)(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, *http.Response, error) { + if a.ListDatabasesRequestExecuteMock == nil { + var localVarReturnValue *ListDatabasesResponse + return localVarReturnValue, &http.Response{}, 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, *http.Response, error) { + if a.ListInstancesRequestExecuteMock == nil { + var localVarReturnValue *ListInstancesResponse + return localVarReturnValue, &http.Response{}, 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, *http.Response, error) { + if a.ListRolesRequestExecuteMock == nil { + var localVarReturnValue *ListRolesResponse + return localVarReturnValue, &http.Response{}, 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, *http.Response, error) { + if a.ListUsersRequestExecuteMock == nil { + var localVarReturnValue *ListUserResponse + return localVarReturnValue, &http.Response{}, 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, *http.Response, error) { + if a.ProtectInstanceRequestExecuteMock == nil { + var localVarReturnValue *ProtectInstanceResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.ProtectInstanceRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ResetUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int64) 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, *http.Response, error) { + if a.ResetUserRequestExecuteMock == nil { + var localVarReturnValue *ResetUserResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.ResetUserRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) RestoreDatabaseFromBackup(ctx context.Context, projectId string, region string, instanceId string) ApiRestoreDatabaseFromBackupRequest { + return ApiRestoreDatabaseFromBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// RestoreDatabaseFromBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the RestoreDatabaseFromBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) RestoreDatabaseFromBackupExecute(r ApiRestoreDatabaseFromBackupRequest) (*http.Response, error) { + if a.RestoreDatabaseFromBackupExecuteMock == nil { + return &http.Response{}, nil + } + + return (*a.RestoreDatabaseFromBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) TriggerBackupRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiTriggerBackupRequestRequest { + return ApiTriggerBackupRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + databaseName: databaseName, + } +} + +// TriggerBackupRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the TriggerBackupRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) TriggerBackupRequestExecute(r ApiTriggerBackupRequestRequest) (*http.Response, error) { + if a.TriggerBackupRequestExecuteMock == nil { + return &http.Response{}, nil + } + + return (*a.TriggerBackupRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) TriggerRestoreRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiTriggerRestoreRequestRequest { + return ApiTriggerRestoreRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + databaseName: databaseName, + } +} + +// TriggerRestoreRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the TriggerRestoreRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) TriggerRestoreRequestExecute(r ApiTriggerRestoreRequestRequest) (*http.Response, error) { + if a.TriggerRestoreRequestExecuteMock == nil { + return &http.Response{}, nil + } + + return (*a.TriggerRestoreRequestExecuteMock)(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) (*http.Response, error) { + if a.UpdateInstancePartiallyRequestExecuteMock == nil { + return &http.Response{}, 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) (*http.Response, error) { + if a.UpdateInstanceRequestExecuteMock == nil { + return &http.Response{}, nil + } + + return (*a.UpdateInstanceRequestExecuteMock)(r) +} diff --git a/services/sqlserverflex/v3alpha1api/client.go b/services/sqlserverflex/v3alpha1api/client.go new file mode 100644 index 000000000..0db3a9a27 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/client.go @@ -0,0 +1,659 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 STACKIT MSSQL Service 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/sqlserverflex/v3alpha1api/configuration.go b/services/sqlserverflex/v3alpha1api/configuration.go new file mode 100644 index 000000000..4639b4e57 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/configuration.go @@ -0,0 +1,41 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex", + Debug: false, + Servers: config.ServerConfigurations{ + { + URL: "https://mssql-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/sqlserverflex/v3alpha1api/model_backup_running_restore.go b/services/sqlserverflex/v3alpha1api/model_backup_running_restore.go new file mode 100644 index 000000000..f7b25ecea --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_backup_running_restore.go @@ -0,0 +1,274 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 BackupRunningRestore type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BackupRunningRestore{} + +// BackupRunningRestore struct for BackupRunningRestore +type BackupRunningRestore struct { + // the command that was executed + Command string `json:"command" validate:"required,restoreCommand"` + // the name of the database that is being restored + DatabaseName string `json:"database_name" validate:"required,databaseName"` + // the projected time when the restore should be completed + EstimatedCompletionTime string `json:"estimated_completion_time" validate:"required,time"` + // the percentage of the current running restore job + PercentComplete int32 `json:"percent_complete" validate:"required,min=0,max=100"` + // the start time of the current running restore job + StartTime string `json:"start_time" validate:"required,time"` +} + +type _BackupRunningRestore BackupRunningRestore + +// NewBackupRunningRestore instantiates a new BackupRunningRestore object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBackupRunningRestore(command string, databaseName string, estimatedCompletionTime string, percentComplete int32, startTime string) *BackupRunningRestore { + this := BackupRunningRestore{} + this.Command = command + this.DatabaseName = databaseName + this.EstimatedCompletionTime = estimatedCompletionTime + this.PercentComplete = percentComplete + this.StartTime = startTime + return &this +} + +// NewBackupRunningRestoreWithDefaults instantiates a new BackupRunningRestore object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBackupRunningRestoreWithDefaults() *BackupRunningRestore { + this := BackupRunningRestore{} + return &this +} + +// GetCommand returns the Command field value +func (o *BackupRunningRestore) GetCommand() string { + if o == nil { + var ret string + return ret + } + + return o.Command +} + +// GetCommandOk returns a tuple with the Command field value +// and a boolean to check if the value has been set. +func (o *BackupRunningRestore) GetCommandOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Command, true +} + +// SetCommand sets field value +func (o *BackupRunningRestore) SetCommand(v string) { + o.Command = v +} + +// GetDatabaseName returns the DatabaseName field value +func (o *BackupRunningRestore) GetDatabaseName() string { + if o == nil { + var ret string + return ret + } + + return o.DatabaseName +} + +// GetDatabaseNameOk returns a tuple with the DatabaseName field value +// and a boolean to check if the value has been set. +func (o *BackupRunningRestore) GetDatabaseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DatabaseName, true +} + +// SetDatabaseName sets field value +func (o *BackupRunningRestore) SetDatabaseName(v string) { + o.DatabaseName = v +} + +// GetEstimatedCompletionTime returns the EstimatedCompletionTime field value +func (o *BackupRunningRestore) GetEstimatedCompletionTime() string { + if o == nil { + var ret string + return ret + } + + return o.EstimatedCompletionTime +} + +// GetEstimatedCompletionTimeOk returns a tuple with the EstimatedCompletionTime field value +// and a boolean to check if the value has been set. +func (o *BackupRunningRestore) GetEstimatedCompletionTimeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EstimatedCompletionTime, true +} + +// SetEstimatedCompletionTime sets field value +func (o *BackupRunningRestore) SetEstimatedCompletionTime(v string) { + o.EstimatedCompletionTime = v +} + +// GetPercentComplete returns the PercentComplete field value +func (o *BackupRunningRestore) GetPercentComplete() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.PercentComplete +} + +// GetPercentCompleteOk returns a tuple with the PercentComplete field value +// and a boolean to check if the value has been set. +func (o *BackupRunningRestore) GetPercentCompleteOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.PercentComplete, true +} + +// SetPercentComplete sets field value +func (o *BackupRunningRestore) SetPercentComplete(v int32) { + o.PercentComplete = v +} + +// GetStartTime returns the StartTime field value +func (o *BackupRunningRestore) GetStartTime() string { + if o == nil { + var ret string + return ret + } + + return o.StartTime +} + +// GetStartTimeOk returns a tuple with the StartTime field value +// and a boolean to check if the value has been set. +func (o *BackupRunningRestore) GetStartTimeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.StartTime, true +} + +// SetStartTime sets field value +func (o *BackupRunningRestore) SetStartTime(v string) { + o.StartTime = v +} + +func (o BackupRunningRestore) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BackupRunningRestore) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["command"] = o.Command + toSerialize["database_name"] = o.DatabaseName + toSerialize["estimated_completion_time"] = o.EstimatedCompletionTime + toSerialize["percent_complete"] = o.PercentComplete + toSerialize["start_time"] = o.StartTime + return toSerialize, nil +} + +func (o *BackupRunningRestore) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "command", + "database_name", + "estimated_completion_time", + "percent_complete", + "start_time", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBackupRunningRestore := _BackupRunningRestore{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBackupRunningRestore) + + if err != nil { + return err + } + + *o = BackupRunningRestore(varBackupRunningRestore) + + return err +} + +type NullableBackupRunningRestore struct { + value *BackupRunningRestore + isSet bool +} + +func (v NullableBackupRunningRestore) Get() *BackupRunningRestore { + return v.value +} + +func (v *NullableBackupRunningRestore) Set(val *BackupRunningRestore) { + v.value = val + v.isSet = true +} + +func (v NullableBackupRunningRestore) IsSet() bool { + return v.isSet +} + +func (v *NullableBackupRunningRestore) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackupRunningRestore(val *BackupRunningRestore) *NullableBackupRunningRestore { + return &NullableBackupRunningRestore{value: val, isSet: true} +} + +func (v NullableBackupRunningRestore) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackupRunningRestore) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3alpha1api/model_backup_sort.go b/services/sqlserverflex/v3alpha1api/model_backup_sort.go new file mode 100644 index 000000000..10e329166 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_backup_sort.go @@ -0,0 +1,131 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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_END_TIME_DESC BackupSort = "end_time.desc" + BACKUPSORT_END_TIME_ASC BackupSort = "end_time.asc" + BACKUPSORT_INDEX_DESC BackupSort = "index.desc" + BACKUPSORT_INDEX_ASC BackupSort = "index.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{ + "end_time.desc", + "end_time.asc", + "index.desc", + "index.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/sqlserverflex/v3alpha1api/model_create_database_request_payload.go b/services/sqlserverflex/v3alpha1api/model_create_database_request_payload.go new file mode 100644 index 000000000..4fc9a2a66 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_create_database_request_payload.go @@ -0,0 +1,261 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 collation of the database. This database collation should match the *collation_name* of one of the collations given by the **Get database collation list** endpoint. + Collation *string `json:"collation,omitempty"` + // CompatibilityLevel of the Database. + Compatibility *int32 `json:"compatibility,omitempty"` + // The name of the database. + Name string `json:"name"` + // The owner of the database. + Owner string `json:"owner"` +} + +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, owner string) *CreateDatabaseRequestPayload { + this := CreateDatabaseRequestPayload{} + this.Name = name + this.Owner = owner + 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 +} + +// GetCollation returns the Collation field value if set, zero value otherwise. +func (o *CreateDatabaseRequestPayload) GetCollation() string { + if o == nil || IsNil(o.Collation) { + var ret string + return ret + } + return *o.Collation +} + +// GetCollationOk returns a tuple with the Collation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateDatabaseRequestPayload) GetCollationOk() (*string, bool) { + if o == nil || IsNil(o.Collation) { + return nil, false + } + return o.Collation, true +} + +// HasCollation returns a boolean if a field has been set. +func (o *CreateDatabaseRequestPayload) HasCollation() bool { + if o != nil && !IsNil(o.Collation) { + return true + } + + return false +} + +// SetCollation gets a reference to the given string and assigns it to the Collation field. +func (o *CreateDatabaseRequestPayload) SetCollation(v string) { + o.Collation = &v +} + +// GetCompatibility returns the Compatibility field value if set, zero value otherwise. +func (o *CreateDatabaseRequestPayload) GetCompatibility() int32 { + if o == nil || IsNil(o.Compatibility) { + var ret int32 + return ret + } + return *o.Compatibility +} + +// GetCompatibilityOk returns a tuple with the Compatibility field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateDatabaseRequestPayload) GetCompatibilityOk() (*int32, bool) { + if o == nil || IsNil(o.Compatibility) { + return nil, false + } + return o.Compatibility, true +} + +// HasCompatibility returns a boolean if a field has been set. +func (o *CreateDatabaseRequestPayload) HasCompatibility() bool { + if o != nil && !IsNil(o.Compatibility) { + return true + } + + return false +} + +// SetCompatibility gets a reference to the given int32 and assigns it to the Compatibility field. +func (o *CreateDatabaseRequestPayload) SetCompatibility(v int32) { + o.Compatibility = &v +} + +// 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 +func (o *CreateDatabaseRequestPayload) 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 *CreateDatabaseRequestPayload) GetOwnerOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Owner, true +} + +// SetOwner sets field value +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{}{} + if !IsNil(o.Collation) { + toSerialize["collation"] = o.Collation + } + if !IsNil(o.Compatibility) { + toSerialize["compatibility"] = o.Compatibility + } + toSerialize["name"] = o.Name + 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", + "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) + } + } + + 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/sqlserverflex/v3alpha1api/model_create_database_response.go b/services/sqlserverflex/v3alpha1api/model_create_database_response.go new file mode 100644 index 000000000..69a54ec74 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_create_database_response.go @@ -0,0 +1,158 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 int64 `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 int64) *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() int64 { + if o == nil { + var ret int64 + 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() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CreateDatabaseResponse) SetId(v int64) { + 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/sqlserverflex/v3alpha1api/model_create_instance_request_payload.go b/services/sqlserverflex/v3alpha1api/model_create_instance_request_payload.go new file mode 100644 index 000000000..89689efb4 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_create_instance_request_payload.go @@ -0,0 +1,365 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 on what time and how often the database backup will be created. 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 CreateInstanceRequestPayloadNetwork `json:"network"` + // The days for how long the backup files should be stored before cleaned up. 30 to 365 + RetentionDays int32 `json:"retentionDays"` + Storage StorageCreate `json:"storage"` + Version InstanceVersion `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 CreateInstanceRequestPayloadNetwork, retentionDays int32, storage StorageCreate, version InstanceVersion) *CreateInstanceRequestPayload { + this := CreateInstanceRequestPayload{} + this.BackupSchedule = backupSchedule + this.FlavorId = flavorId + this.Name = name + this.Network = network + 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() CreateInstanceRequestPayloadNetwork { + if o == nil { + var ret CreateInstanceRequestPayloadNetwork + 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() (*CreateInstanceRequestPayloadNetwork, bool) { + if o == nil { + return nil, false + } + return &o.Network, true +} + +// SetNetwork sets field value +func (o *CreateInstanceRequestPayload) SetNetwork(v CreateInstanceRequestPayloadNetwork) { + o.Network = 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() InstanceVersion { + if o == nil { + var ret InstanceVersion + 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() (*InstanceVersion, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *CreateInstanceRequestPayload) SetVersion(v InstanceVersion) { + 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["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", + "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/sqlserverflex/v3alpha1api/model_create_instance_request_payload_network.go b/services/sqlserverflex/v3alpha1api/model_create_instance_request_payload_network.go new file mode 100644 index 000000000..ac5c289b7 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_create_instance_request_payload_network.go @@ -0,0 +1,198 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 CreateInstanceRequestPayloadNetwork type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateInstanceRequestPayloadNetwork{} + +// CreateInstanceRequestPayloadNetwork the network configuration of the instance. +type CreateInstanceRequestPayloadNetwork struct { + AccessScope *InstanceNetworkAccessScope `json:"accessScope,omitempty"` + // List of IPV4 cidr. + Acl []string `json:"acl"` +} + +type _CreateInstanceRequestPayloadNetwork CreateInstanceRequestPayloadNetwork + +// NewCreateInstanceRequestPayloadNetwork instantiates a new CreateInstanceRequestPayloadNetwork object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateInstanceRequestPayloadNetwork(acl []string) *CreateInstanceRequestPayloadNetwork { + this := CreateInstanceRequestPayloadNetwork{} + var accessScope InstanceNetworkAccessScope = INSTANCENETWORKACCESSSCOPE_PUBLIC + this.AccessScope = &accessScope + this.Acl = acl + return &this +} + +// NewCreateInstanceRequestPayloadNetworkWithDefaults instantiates a new CreateInstanceRequestPayloadNetwork object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateInstanceRequestPayloadNetworkWithDefaults() *CreateInstanceRequestPayloadNetwork { + this := CreateInstanceRequestPayloadNetwork{} + var accessScope InstanceNetworkAccessScope = INSTANCENETWORKACCESSSCOPE_PUBLIC + this.AccessScope = &accessScope + return &this +} + +// GetAccessScope returns the AccessScope field value if set, zero value otherwise. +func (o *CreateInstanceRequestPayloadNetwork) 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 *CreateInstanceRequestPayloadNetwork) 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 *CreateInstanceRequestPayloadNetwork) 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 *CreateInstanceRequestPayloadNetwork) SetAccessScope(v InstanceNetworkAccessScope) { + o.AccessScope = &v +} + +// GetAcl returns the Acl field value +func (o *CreateInstanceRequestPayloadNetwork) 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 *CreateInstanceRequestPayloadNetwork) GetAclOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Acl, true +} + +// SetAcl sets field value +func (o *CreateInstanceRequestPayloadNetwork) SetAcl(v []string) { + o.Acl = v +} + +func (o CreateInstanceRequestPayloadNetwork) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateInstanceRequestPayloadNetwork) 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 *CreateInstanceRequestPayloadNetwork) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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) + } + } + + varCreateInstanceRequestPayloadNetwork := _CreateInstanceRequestPayloadNetwork{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateInstanceRequestPayloadNetwork) + + if err != nil { + return err + } + + *o = CreateInstanceRequestPayloadNetwork(varCreateInstanceRequestPayloadNetwork) + + return err +} + +type NullableCreateInstanceRequestPayloadNetwork struct { + value *CreateInstanceRequestPayloadNetwork + isSet bool +} + +func (v NullableCreateInstanceRequestPayloadNetwork) Get() *CreateInstanceRequestPayloadNetwork { + return v.value +} + +func (v *NullableCreateInstanceRequestPayloadNetwork) Set(val *CreateInstanceRequestPayloadNetwork) { + v.value = val + v.isSet = true +} + +func (v NullableCreateInstanceRequestPayloadNetwork) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateInstanceRequestPayloadNetwork) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateInstanceRequestPayloadNetwork(val *CreateInstanceRequestPayloadNetwork) *NullableCreateInstanceRequestPayloadNetwork { + return &NullableCreateInstanceRequestPayloadNetwork{value: val, isSet: true} +} + +func (v NullableCreateInstanceRequestPayloadNetwork) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateInstanceRequestPayloadNetwork) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3alpha1api/model_create_instance_response.go b/services/sqlserverflex/v3alpha1api/model_create_instance_response.go new file mode 100644 index 000000000..9875cd134 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_create_instance_response.go @@ -0,0 +1,158 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v3alpha1api/model_create_user_request_payload.go b/services/sqlserverflex/v3alpha1api/model_create_user_request_payload.go new file mode 100644 index 000000000..aefa5db35 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_create_user_request_payload.go @@ -0,0 +1,224 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 default database for a user of the instance. + DefaultDatabase *string `json:"default_database,omitempty"` + // A list containing the user roles for the instance. A list with the valid user roles can be retrieved using the List Roles endpoint. + Roles []string `json:"roles"` + // The name of the user. + Username string `json:"username"` +} + +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(roles []string, username string) *CreateUserRequestPayload { + this := CreateUserRequestPayload{} + this.Roles = roles + this.Username = username + 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 +} + +// GetDefaultDatabase returns the DefaultDatabase field value if set, zero value otherwise. +func (o *CreateUserRequestPayload) GetDefaultDatabase() string { + if o == nil || IsNil(o.DefaultDatabase) { + var ret string + return ret + } + return *o.DefaultDatabase +} + +// GetDefaultDatabaseOk returns a tuple with the DefaultDatabase field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateUserRequestPayload) GetDefaultDatabaseOk() (*string, bool) { + if o == nil || IsNil(o.DefaultDatabase) { + return nil, false + } + return o.DefaultDatabase, true +} + +// HasDefaultDatabase returns a boolean if a field has been set. +func (o *CreateUserRequestPayload) HasDefaultDatabase() bool { + if o != nil && !IsNil(o.DefaultDatabase) { + return true + } + + return false +} + +// SetDefaultDatabase gets a reference to the given string and assigns it to the DefaultDatabase field. +func (o *CreateUserRequestPayload) SetDefaultDatabase(v string) { + o.DefaultDatabase = &v +} + +// GetRoles returns the Roles field value +func (o *CreateUserRequestPayload) 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 *CreateUserRequestPayload) GetRolesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Roles, true +} + +// SetRoles sets field value +func (o *CreateUserRequestPayload) SetRoles(v []string) { + o.Roles = v +} + +// GetUsername returns the Username field value +func (o *CreateUserRequestPayload) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *CreateUserRequestPayload) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *CreateUserRequestPayload) SetUsername(v string) { + o.Username = 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{}{} + if !IsNil(o.DefaultDatabase) { + toSerialize["default_database"] = o.DefaultDatabase + } + toSerialize["roles"] = o.Roles + toSerialize["username"] = o.Username + 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{ + "roles", + "username", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if 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/sqlserverflex/v3alpha1api/model_create_user_response.go b/services/sqlserverflex/v3alpha1api/model_create_user_response.go new file mode 100644 index 000000000..e5abcc58a --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_create_user_response.go @@ -0,0 +1,389 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 default database for a user of the instance. + DefaultDatabase string `json:"default_database"` + // The host of the instance in which the user belongs to. + Host string `json:"host"` + // The ID of the user. + Id int64 `json:"id"` + // The password for the user. + Password string `json:"password"` + // The port of the instance in which the user belongs to. + Port int32 `json:"port"` + Roles []string `json:"roles"` + // The current status of the user. + Status string `json:"status"` + // The connection string for the user to the instance. + Uri string `json:"uri"` + // The name of the user. + Username string `json:"username"` +} + +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(defaultDatabase string, host string, id int64, password string, port int32, roles []string, status string, uri string, username string) *CreateUserResponse { + this := CreateUserResponse{} + this.DefaultDatabase = defaultDatabase + this.Host = host + this.Id = id + this.Password = password + this.Port = port + this.Roles = roles + this.Status = status + this.Uri = uri + this.Username = username + 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 +} + +// GetDefaultDatabase returns the DefaultDatabase field value +func (o *CreateUserResponse) GetDefaultDatabase() string { + if o == nil { + var ret string + return ret + } + + return o.DefaultDatabase +} + +// GetDefaultDatabaseOk returns a tuple with the DefaultDatabase field value +// and a boolean to check if the value has been set. +func (o *CreateUserResponse) GetDefaultDatabaseOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DefaultDatabase, true +} + +// SetDefaultDatabase sets field value +func (o *CreateUserResponse) SetDefaultDatabase(v string) { + o.DefaultDatabase = v +} + +// GetHost returns the Host field value +func (o *CreateUserResponse) 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 *CreateUserResponse) GetHostOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Host, true +} + +// SetHost sets field value +func (o *CreateUserResponse) SetHost(v string) { + o.Host = v +} + +// GetId returns the Id field value +func (o *CreateUserResponse) GetId() int64 { + if o == nil { + var ret int64 + 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() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CreateUserResponse) SetId(v int64) { + o.Id = 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 +} + +// GetPort returns the Port field value +func (o *CreateUserResponse) 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 *CreateUserResponse) GetPortOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Port, true +} + +// SetPort sets field value +func (o *CreateUserResponse) SetPort(v int32) { + o.Port = v +} + +// GetRoles returns the Roles field value +func (o *CreateUserResponse) 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 *CreateUserResponse) GetRolesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Roles, true +} + +// SetRoles sets field value +func (o *CreateUserResponse) SetRoles(v []string) { + o.Roles = 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 +} + +// GetUri returns the Uri field value +func (o *CreateUserResponse) GetUri() string { + if o == nil { + var ret string + return ret + } + + return o.Uri +} + +// GetUriOk returns a tuple with the Uri field value +// and a boolean to check if the value has been set. +func (o *CreateUserResponse) GetUriOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Uri, true +} + +// SetUri sets field value +func (o *CreateUserResponse) SetUri(v string) { + o.Uri = v +} + +// GetUsername returns the Username field value +func (o *CreateUserResponse) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *CreateUserResponse) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *CreateUserResponse) SetUsername(v string) { + o.Username = 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["default_database"] = o.DefaultDatabase + toSerialize["host"] = o.Host + toSerialize["id"] = o.Id + toSerialize["password"] = o.Password + toSerialize["port"] = o.Port + toSerialize["roles"] = o.Roles + toSerialize["status"] = o.Status + toSerialize["uri"] = o.Uri + toSerialize["username"] = o.Username + 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{ + "default_database", + "host", + "id", + "password", + "port", + "roles", + "status", + "uri", + "username", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if 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/sqlserverflex/v3alpha1api/model_database_getcollation.go b/services/sqlserverflex/v3alpha1api/model_database_getcollation.go new file mode 100644 index 000000000..fba5d4865 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_database_getcollation.go @@ -0,0 +1,161 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 DatabaseGetcollation type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DatabaseGetcollation{} + +// DatabaseGetcollation struct for DatabaseGetcollation +type DatabaseGetcollation struct { + CollationName *string `json:"collation_name,omitempty"` + Description *string `json:"description,omitempty"` +} + +// NewDatabaseGetcollation instantiates a new DatabaseGetcollation object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDatabaseGetcollation() *DatabaseGetcollation { + this := DatabaseGetcollation{} + return &this +} + +// NewDatabaseGetcollationWithDefaults instantiates a new DatabaseGetcollation object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDatabaseGetcollationWithDefaults() *DatabaseGetcollation { + this := DatabaseGetcollation{} + return &this +} + +// GetCollationName returns the CollationName field value if set, zero value otherwise. +func (o *DatabaseGetcollation) GetCollationName() string { + if o == nil || IsNil(o.CollationName) { + var ret string + return ret + } + return *o.CollationName +} + +// GetCollationNameOk returns a tuple with the CollationName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DatabaseGetcollation) GetCollationNameOk() (*string, bool) { + if o == nil || IsNil(o.CollationName) { + return nil, false + } + return o.CollationName, true +} + +// HasCollationName returns a boolean if a field has been set. +func (o *DatabaseGetcollation) HasCollationName() bool { + if o != nil && !IsNil(o.CollationName) { + return true + } + + return false +} + +// SetCollationName gets a reference to the given string and assigns it to the CollationName field. +func (o *DatabaseGetcollation) SetCollationName(v string) { + o.CollationName = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *DatabaseGetcollation) 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 *DatabaseGetcollation) 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 *DatabaseGetcollation) 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 *DatabaseGetcollation) SetDescription(v string) { + o.Description = &v +} + +func (o DatabaseGetcollation) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DatabaseGetcollation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CollationName) { + toSerialize["collation_name"] = o.CollationName + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + return toSerialize, nil +} + +type NullableDatabaseGetcollation struct { + value *DatabaseGetcollation + isSet bool +} + +func (v NullableDatabaseGetcollation) Get() *DatabaseGetcollation { + return v.value +} + +func (v *NullableDatabaseGetcollation) Set(val *DatabaseGetcollation) { + v.value = val + v.isSet = true +} + +func (v NullableDatabaseGetcollation) IsSet() bool { + return v.isSet +} + +func (v *NullableDatabaseGetcollation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDatabaseGetcollation(val *DatabaseGetcollation) *NullableDatabaseGetcollation { + return &NullableDatabaseGetcollation{value: val, isSet: true} +} + +func (v NullableDatabaseGetcollation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDatabaseGetcollation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3alpha1api/model_database_getcompatibility.go b/services/sqlserverflex/v3alpha1api/model_database_getcompatibility.go new file mode 100644 index 000000000..c197d6dc4 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_database_getcompatibility.go @@ -0,0 +1,161 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 DatabaseGetcompatibility type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DatabaseGetcompatibility{} + +// DatabaseGetcompatibility struct for DatabaseGetcompatibility +type DatabaseGetcompatibility struct { + CompatibilityLevel *int32 `json:"compatibility_level,omitempty"` + Description *string `json:"description,omitempty"` +} + +// NewDatabaseGetcompatibility instantiates a new DatabaseGetcompatibility object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDatabaseGetcompatibility() *DatabaseGetcompatibility { + this := DatabaseGetcompatibility{} + return &this +} + +// NewDatabaseGetcompatibilityWithDefaults instantiates a new DatabaseGetcompatibility object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDatabaseGetcompatibilityWithDefaults() *DatabaseGetcompatibility { + this := DatabaseGetcompatibility{} + return &this +} + +// GetCompatibilityLevel returns the CompatibilityLevel field value if set, zero value otherwise. +func (o *DatabaseGetcompatibility) GetCompatibilityLevel() int32 { + if o == nil || IsNil(o.CompatibilityLevel) { + var ret int32 + return ret + } + return *o.CompatibilityLevel +} + +// GetCompatibilityLevelOk returns a tuple with the CompatibilityLevel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DatabaseGetcompatibility) GetCompatibilityLevelOk() (*int32, bool) { + if o == nil || IsNil(o.CompatibilityLevel) { + return nil, false + } + return o.CompatibilityLevel, true +} + +// HasCompatibilityLevel returns a boolean if a field has been set. +func (o *DatabaseGetcompatibility) HasCompatibilityLevel() bool { + if o != nil && !IsNil(o.CompatibilityLevel) { + return true + } + + return false +} + +// SetCompatibilityLevel gets a reference to the given int32 and assigns it to the CompatibilityLevel field. +func (o *DatabaseGetcompatibility) SetCompatibilityLevel(v int32) { + o.CompatibilityLevel = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *DatabaseGetcompatibility) 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 *DatabaseGetcompatibility) 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 *DatabaseGetcompatibility) 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 *DatabaseGetcompatibility) SetDescription(v string) { + o.Description = &v +} + +func (o DatabaseGetcompatibility) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DatabaseGetcompatibility) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CompatibilityLevel) { + toSerialize["compatibility_level"] = o.CompatibilityLevel + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + return toSerialize, nil +} + +type NullableDatabaseGetcompatibility struct { + value *DatabaseGetcompatibility + isSet bool +} + +func (v NullableDatabaseGetcompatibility) Get() *DatabaseGetcompatibility { + return v.value +} + +func (v *NullableDatabaseGetcompatibility) Set(val *DatabaseGetcompatibility) { + v.value = val + v.isSet = true +} + +func (v NullableDatabaseGetcompatibility) IsSet() bool { + return v.isSet +} + +func (v *NullableDatabaseGetcompatibility) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDatabaseGetcompatibility(val *DatabaseGetcompatibility) *NullableDatabaseGetcompatibility { + return &NullableDatabaseGetcompatibility{value: val, isSet: true} +} + +func (v NullableDatabaseGetcompatibility) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDatabaseGetcompatibility) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3alpha1api/model_database_roles.go b/services/sqlserverflex/v3alpha1api/model_database_roles.go new file mode 100644 index 000000000..44ad6729b --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_database_roles.go @@ -0,0 +1,187 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v3alpha1api/model_database_sort.go b/services/sqlserverflex/v3alpha1api/model_database_sort.go new file mode 100644 index 000000000..df4a49184 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_database_sort.go @@ -0,0 +1,127 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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" + DATABASESORT_INDEX_ASC DatabaseSort = "index.asc" + DATABASESORT_INDEX_DESC DatabaseSort = "index.desc" +) + +// 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", + "index.asc", + "index.desc", +} + +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/sqlserverflex/v3alpha1api/model_error.go b/services/sqlserverflex/v3alpha1api/model_error.go new file mode 100644 index 000000000..41581676a --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_error.go @@ -0,0 +1,245 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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" validate:"required,errorCode"` + // More detailed information about the error. + Message string `json:"message" validate:"required,errorMsg"` + // The trace id of the request. + TraceId string `json:"traceId" validate:"required,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/sqlserverflex/v3alpha1api/model_external_s3.go b/services/sqlserverflex/v3alpha1api/model_external_s3.go new file mode 100644 index 000000000..27b628e45 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_external_s3.go @@ -0,0 +1,245 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 ExternalS3 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ExternalS3{} + +// ExternalS3 The external S3 information +type ExternalS3 struct { + // The s3 access key id + S3AccessKey string `json:"s3_access_key"` + // The s3 access secret + S3AccessSecret string `json:"s3_access_secret"` + // The s3 bucket address + S3Bucket string `json:"s3_bucket"` + // The backup files from which the database should be restored + S3Files []S3fileInfo `json:"s3_files"` +} + +type _ExternalS3 ExternalS3 + +// NewExternalS3 instantiates a new ExternalS3 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewExternalS3(s3AccessKey string, s3AccessSecret string, s3Bucket string, s3Files []S3fileInfo) *ExternalS3 { + this := ExternalS3{} + this.S3AccessKey = s3AccessKey + this.S3AccessSecret = s3AccessSecret + this.S3Bucket = s3Bucket + this.S3Files = s3Files + return &this +} + +// NewExternalS3WithDefaults instantiates a new ExternalS3 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewExternalS3WithDefaults() *ExternalS3 { + this := ExternalS3{} + return &this +} + +// GetS3AccessKey returns the S3AccessKey field value +func (o *ExternalS3) GetS3AccessKey() string { + if o == nil { + var ret string + return ret + } + + return o.S3AccessKey +} + +// GetS3AccessKeyOk returns a tuple with the S3AccessKey field value +// and a boolean to check if the value has been set. +func (o *ExternalS3) GetS3AccessKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.S3AccessKey, true +} + +// SetS3AccessKey sets field value +func (o *ExternalS3) SetS3AccessKey(v string) { + o.S3AccessKey = v +} + +// GetS3AccessSecret returns the S3AccessSecret field value +func (o *ExternalS3) GetS3AccessSecret() string { + if o == nil { + var ret string + return ret + } + + return o.S3AccessSecret +} + +// GetS3AccessSecretOk returns a tuple with the S3AccessSecret field value +// and a boolean to check if the value has been set. +func (o *ExternalS3) GetS3AccessSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.S3AccessSecret, true +} + +// SetS3AccessSecret sets field value +func (o *ExternalS3) SetS3AccessSecret(v string) { + o.S3AccessSecret = v +} + +// GetS3Bucket returns the S3Bucket field value +func (o *ExternalS3) GetS3Bucket() string { + if o == nil { + var ret string + return ret + } + + return o.S3Bucket +} + +// GetS3BucketOk returns a tuple with the S3Bucket field value +// and a boolean to check if the value has been set. +func (o *ExternalS3) GetS3BucketOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.S3Bucket, true +} + +// SetS3Bucket sets field value +func (o *ExternalS3) SetS3Bucket(v string) { + o.S3Bucket = v +} + +// GetS3Files returns the S3Files field value +func (o *ExternalS3) GetS3Files() []S3fileInfo { + if o == nil { + var ret []S3fileInfo + return ret + } + + return o.S3Files +} + +// GetS3FilesOk returns a tuple with the S3Files field value +// and a boolean to check if the value has been set. +func (o *ExternalS3) GetS3FilesOk() ([]S3fileInfo, bool) { + if o == nil { + return nil, false + } + return o.S3Files, true +} + +// SetS3Files sets field value +func (o *ExternalS3) SetS3Files(v []S3fileInfo) { + o.S3Files = v +} + +func (o ExternalS3) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ExternalS3) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["s3_access_key"] = o.S3AccessKey + toSerialize["s3_access_secret"] = o.S3AccessSecret + toSerialize["s3_bucket"] = o.S3Bucket + toSerialize["s3_files"] = o.S3Files + return toSerialize, nil +} + +func (o *ExternalS3) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "s3_access_key", + "s3_access_secret", + "s3_bucket", + "s3_files", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varExternalS3 := _ExternalS3{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varExternalS3) + + if err != nil { + return err + } + + *o = ExternalS3(varExternalS3) + + return err +} + +type NullableExternalS3 struct { + value *ExternalS3 + isSet bool +} + +func (v NullableExternalS3) Get() *ExternalS3 { + return v.value +} + +func (v *NullableExternalS3) Set(val *ExternalS3) { + v.value = val + v.isSet = true +} + +func (v NullableExternalS3) IsSet() bool { + return v.isSet +} + +func (v *NullableExternalS3) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableExternalS3(val *ExternalS3) *NullableExternalS3 { + return &NullableExternalS3{value: val, isSet: true} +} + +func (v NullableExternalS3) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableExternalS3) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3alpha1api/model_flavor_sort.go b/services/sqlserverflex/v3alpha1api/model_flavor_sort.go new file mode 100644 index 000000000..46f9a739b --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_flavor_sort.go @@ -0,0 +1,143 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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_INDEX_DESC FlavorSort = "index.desc" + FLAVORSORT_INDEX_ASC FlavorSort = "index.asc" + 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{ + "index.desc", + "index.asc", + "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/sqlserverflex/v3alpha1api/model_flavor_storage_classes_storage_class.go b/services/sqlserverflex/v3alpha1api/model_flavor_storage_classes_storage_class.go new file mode 100644 index 000000000..391f5bc37 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_flavor_storage_classes_storage_class.go @@ -0,0 +1,213 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v3alpha1api/model_flavor_storage_range.go b/services/sqlserverflex/v3alpha1api/model_flavor_storage_range.go new file mode 100644 index 000000000..fbb977dbb --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_flavor_storage_range.go @@ -0,0 +1,187 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 FlavorStorageRange type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FlavorStorageRange{} + +// FlavorStorageRange range of maximum and minimum storage which can be ordered for the flavor in Gigabyte. +type FlavorStorageRange struct { + // maximum storage which can be ordered for the flavor in Gigabyte. + Max int32 `json:"max"` + // minimum storage which is required to order in Gigabyte. + Min int32 `json:"min"` +} + +type _FlavorStorageRange FlavorStorageRange + +// NewFlavorStorageRange instantiates a new FlavorStorageRange object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFlavorStorageRange(max int32, min int32) *FlavorStorageRange { + this := FlavorStorageRange{} + this.Max = max + this.Min = min + return &this +} + +// NewFlavorStorageRangeWithDefaults instantiates a new FlavorStorageRange object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFlavorStorageRangeWithDefaults() *FlavorStorageRange { + this := FlavorStorageRange{} + return &this +} + +// GetMax returns the Max field value +func (o *FlavorStorageRange) 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 *FlavorStorageRange) GetMaxOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Max, true +} + +// SetMax sets field value +func (o *FlavorStorageRange) SetMax(v int32) { + o.Max = v +} + +// GetMin returns the Min field value +func (o *FlavorStorageRange) 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 *FlavorStorageRange) GetMinOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Min, true +} + +// SetMin sets field value +func (o *FlavorStorageRange) SetMin(v int32) { + o.Min = v +} + +func (o FlavorStorageRange) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FlavorStorageRange) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["max"] = o.Max + toSerialize["min"] = o.Min + return toSerialize, nil +} + +func (o *FlavorStorageRange) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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) + } + } + + varFlavorStorageRange := _FlavorStorageRange{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varFlavorStorageRange) + + if err != nil { + return err + } + + *o = FlavorStorageRange(varFlavorStorageRange) + + return err +} + +type NullableFlavorStorageRange struct { + value *FlavorStorageRange + isSet bool +} + +func (v NullableFlavorStorageRange) Get() *FlavorStorageRange { + return v.value +} + +func (v *NullableFlavorStorageRange) Set(val *FlavorStorageRange) { + v.value = val + v.isSet = true +} + +func (v NullableFlavorStorageRange) IsSet() bool { + return v.isSet +} + +func (v *NullableFlavorStorageRange) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFlavorStorageRange(val *FlavorStorageRange) *NullableFlavorStorageRange { + return &NullableFlavorStorageRange{value: val, isSet: true} +} + +func (v NullableFlavorStorageRange) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFlavorStorageRange) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3alpha1api/model_get_backup_response.go b/services/sqlserverflex/v3alpha1api/model_get_backup_response.go new file mode 100644 index 000000000..fb763f4be --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_get_backup_response.go @@ -0,0 +1,303 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 int64 `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 int64 `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 int64, name string, retainedUntil string, size int64, 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() int64 { + if o == nil { + var ret int64 + 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() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *GetBackupResponse) SetId(v int64) { + 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() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value +// and a boolean to check if the value has been set. +func (o *GetBackupResponse) GetSizeOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value +func (o *GetBackupResponse) SetSize(v int64) { + 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/sqlserverflex/v3alpha1api/model_get_collations_response.go b/services/sqlserverflex/v3alpha1api/model_get_collations_response.go new file mode 100644 index 000000000..63b27f147 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_get_collations_response.go @@ -0,0 +1,158 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 []DatabaseGetcollation `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 []DatabaseGetcollation) *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() []DatabaseGetcollation { + if o == nil { + var ret []DatabaseGetcollation + 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() ([]DatabaseGetcollation, bool) { + if o == nil { + return nil, false + } + return o.Collations, true +} + +// SetCollations sets field value +func (o *GetCollationsResponse) SetCollations(v []DatabaseGetcollation) { + 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/sqlserverflex/v3alpha1api/model_get_database_response.go b/services/sqlserverflex/v3alpha1api/model_get_database_response.go new file mode 100644 index 000000000..8e4a4bc10 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_get_database_response.go @@ -0,0 +1,274 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 collation of the database. This database collation should match the *collation_name* of one of the collations given by the **Get database collation list** endpoint. + CollationName string `json:"collationName"` + // CompatibilityLevel of the Database. + CompatibilityLevel int32 `json:"compatibilityLevel"` + // The id of the database. + Id int64 `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(collationName string, compatibilityLevel int32, id int64, name string, owner string) *GetDatabaseResponse { + this := GetDatabaseResponse{} + this.CollationName = collationName + this.CompatibilityLevel = compatibilityLevel + 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 +} + +// GetCollationName returns the CollationName field value +func (o *GetDatabaseResponse) GetCollationName() string { + if o == nil { + var ret string + return ret + } + + return o.CollationName +} + +// GetCollationNameOk returns a tuple with the CollationName field value +// and a boolean to check if the value has been set. +func (o *GetDatabaseResponse) GetCollationNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CollationName, true +} + +// SetCollationName sets field value +func (o *GetDatabaseResponse) SetCollationName(v string) { + o.CollationName = v +} + +// GetCompatibilityLevel returns the CompatibilityLevel field value +func (o *GetDatabaseResponse) GetCompatibilityLevel() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.CompatibilityLevel +} + +// GetCompatibilityLevelOk returns a tuple with the CompatibilityLevel field value +// and a boolean to check if the value has been set. +func (o *GetDatabaseResponse) GetCompatibilityLevelOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.CompatibilityLevel, true +} + +// SetCompatibilityLevel sets field value +func (o *GetDatabaseResponse) SetCompatibilityLevel(v int32) { + o.CompatibilityLevel = v +} + +// GetId returns the Id field value +func (o *GetDatabaseResponse) GetId() int64 { + if o == nil { + var ret int64 + 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() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *GetDatabaseResponse) SetId(v int64) { + 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["collationName"] = o.CollationName + toSerialize["compatibilityLevel"] = o.CompatibilityLevel + 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{ + "collationName", + "compatibilityLevel", + "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/sqlserverflex/v3alpha1api/model_get_flavors_response.go b/services/sqlserverflex/v3alpha1api/model_get_flavors_response.go new file mode 100644 index 000000000..b9cc04f01 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_get_flavors_response.go @@ -0,0 +1,186 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v3alpha1api/model_get_instance_response.go b/services/sqlserverflex/v3alpha1api/model_get_instance_response.go new file mode 100644 index 000000000..ab8acc5af --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_get_instance_response.go @@ -0,0 +1,507 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 { + // The schedule for on what time and how often the database backup will be created. The schedule is written as a cron schedule. + BackupSchedule string `json:"backupSchedule"` + Edition InstanceEdition `json:"edition"` + 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"` + // The days for how long the backup files should be stored before cleaned up. 30 to 365 + RetentionDays int32 `json:"retentionDays"` + Status Status `json:"status"` + Storage Storage `json:"storage"` + Version InstanceVersion `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, edition InstanceEdition, flavorId string, id string, isDeletable bool, name string, network InstanceNetwork, replicas Replicas, retentionDays int32, status Status, storage Storage, version InstanceVersion) *GetInstanceResponse { + this := GetInstanceResponse{} + this.BackupSchedule = backupSchedule + this.Edition = edition + 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 +} + +// 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 +} + +// GetEdition returns the Edition field value +func (o *GetInstanceResponse) GetEdition() InstanceEdition { + if o == nil { + var ret InstanceEdition + return ret + } + + return o.Edition +} + +// GetEditionOk returns a tuple with the Edition field value +// and a boolean to check if the value has been set. +func (o *GetInstanceResponse) GetEditionOk() (*InstanceEdition, bool) { + if o == nil { + return nil, false + } + return &o.Edition, true +} + +// SetEdition sets field value +func (o *GetInstanceResponse) SetEdition(v InstanceEdition) { + o.Edition = 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() InstanceVersion { + if o == nil { + var ret InstanceVersion + 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() (*InstanceVersion, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *GetInstanceResponse) SetVersion(v InstanceVersion) { + 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{}{} + toSerialize["backupSchedule"] = o.BackupSchedule + toSerialize["edition"] = o.Edition + 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", + "edition", + "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/sqlserverflex/v3alpha1api/model_get_storages_response.go b/services/sqlserverflex/v3alpha1api/model_get_storages_response.go new file mode 100644 index 000000000..ecb2bf8ba --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_get_storages_response.go @@ -0,0 +1,186 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 GetStoragesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetStoragesResponse{} + +// GetStoragesResponse struct for GetStoragesResponse +type GetStoragesResponse struct { + // maximum storage which can be ordered for the flavor in Gigabyte. + StorageClasses []FlavorStorageClassesStorageClass `json:"storageClasses"` + StorageRange FlavorStorageRange `json:"storageRange"` +} + +type _GetStoragesResponse GetStoragesResponse + +// NewGetStoragesResponse instantiates a new GetStoragesResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetStoragesResponse(storageClasses []FlavorStorageClassesStorageClass, storageRange FlavorStorageRange) *GetStoragesResponse { + this := GetStoragesResponse{} + this.StorageClasses = storageClasses + this.StorageRange = storageRange + return &this +} + +// NewGetStoragesResponseWithDefaults instantiates a new GetStoragesResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetStoragesResponseWithDefaults() *GetStoragesResponse { + this := GetStoragesResponse{} + return &this +} + +// GetStorageClasses returns the StorageClasses field value +func (o *GetStoragesResponse) 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 *GetStoragesResponse) GetStorageClassesOk() ([]FlavorStorageClassesStorageClass, bool) { + if o == nil { + return nil, false + } + return o.StorageClasses, true +} + +// SetStorageClasses sets field value +func (o *GetStoragesResponse) SetStorageClasses(v []FlavorStorageClassesStorageClass) { + o.StorageClasses = v +} + +// GetStorageRange returns the StorageRange field value +func (o *GetStoragesResponse) GetStorageRange() FlavorStorageRange { + if o == nil { + var ret FlavorStorageRange + return ret + } + + return o.StorageRange +} + +// GetStorageRangeOk returns a tuple with the StorageRange field value +// and a boolean to check if the value has been set. +func (o *GetStoragesResponse) GetStorageRangeOk() (*FlavorStorageRange, bool) { + if o == nil { + return nil, false + } + return &o.StorageRange, true +} + +// SetStorageRange sets field value +func (o *GetStoragesResponse) SetStorageRange(v FlavorStorageRange) { + o.StorageRange = v +} + +func (o GetStoragesResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetStoragesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["storageClasses"] = o.StorageClasses + toSerialize["storageRange"] = o.StorageRange + return toSerialize, nil +} + +func (o *GetStoragesResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "storageClasses", + "storageRange", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetStoragesResponse := _GetStoragesResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetStoragesResponse) + + if err != nil { + return err + } + + *o = GetStoragesResponse(varGetStoragesResponse) + + return err +} + +type NullableGetStoragesResponse struct { + value *GetStoragesResponse + isSet bool +} + +func (v NullableGetStoragesResponse) Get() *GetStoragesResponse { + return v.value +} + +func (v *NullableGetStoragesResponse) Set(val *GetStoragesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetStoragesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetStoragesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetStoragesResponse(val *GetStoragesResponse) *NullableGetStoragesResponse { + return &NullableGetStoragesResponse{value: val, isSet: true} +} + +func (v NullableGetStoragesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetStoragesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3alpha1api/model_get_user_response.go b/services/sqlserverflex/v3alpha1api/model_get_user_response.go new file mode 100644 index 000000000..024c2d474 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_get_user_response.go @@ -0,0 +1,332 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 default database for a user of the instance. + DefaultDatabase string `json:"default_database"` + // The host of the instance in which the user belongs to. + Host string `json:"host"` + // The ID of the user. + Id int64 `json:"id"` + // The port of the instance in which the user belongs to. + Port int32 `json:"port"` + // A list of user roles. + Roles []string `json:"roles"` + // The current status of the user. + Status string `json:"status"` + // The name of the user. + Username string `json:"username"` +} + +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(defaultDatabase string, host string, id int64, port int32, roles []string, status string, username string) *GetUserResponse { + this := GetUserResponse{} + this.DefaultDatabase = defaultDatabase + this.Host = host + this.Id = id + this.Port = port + this.Roles = roles + this.Status = status + this.Username = username + 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 +} + +// GetDefaultDatabase returns the DefaultDatabase field value +func (o *GetUserResponse) GetDefaultDatabase() string { + if o == nil { + var ret string + return ret + } + + return o.DefaultDatabase +} + +// GetDefaultDatabaseOk returns a tuple with the DefaultDatabase field value +// and a boolean to check if the value has been set. +func (o *GetUserResponse) GetDefaultDatabaseOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DefaultDatabase, true +} + +// SetDefaultDatabase sets field value +func (o *GetUserResponse) SetDefaultDatabase(v string) { + o.DefaultDatabase = v +} + +// GetHost returns the Host field value +func (o *GetUserResponse) 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 *GetUserResponse) GetHostOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Host, true +} + +// SetHost sets field value +func (o *GetUserResponse) SetHost(v string) { + o.Host = v +} + +// GetId returns the Id field value +func (o *GetUserResponse) GetId() int64 { + if o == nil { + var ret int64 + 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() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *GetUserResponse) SetId(v int64) { + o.Id = v +} + +// GetPort returns the Port field value +func (o *GetUserResponse) 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 *GetUserResponse) GetPortOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Port, true +} + +// SetPort sets field value +func (o *GetUserResponse) SetPort(v int32) { + o.Port = v +} + +// GetRoles returns the Roles field value +func (o *GetUserResponse) 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 *GetUserResponse) GetRolesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Roles, true +} + +// SetRoles sets field value +func (o *GetUserResponse) SetRoles(v []string) { + 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 +} + +// GetUsername returns the Username field value +func (o *GetUserResponse) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *GetUserResponse) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *GetUserResponse) SetUsername(v string) { + o.Username = 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["default_database"] = o.DefaultDatabase + toSerialize["host"] = o.Host + toSerialize["id"] = o.Id + toSerialize["port"] = o.Port + toSerialize["roles"] = o.Roles + toSerialize["status"] = o.Status + toSerialize["username"] = o.Username + 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{ + "default_database", + "host", + "id", + "port", + "roles", + "status", + "username", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if 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/sqlserverflex/v3alpha1api/model_get_versions_response.go b/services/sqlserverflex/v3alpha1api/model_get_versions_response.go new file mode 100644 index 000000000..d26540591 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_get_versions_response.go @@ -0,0 +1,158 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 sqlserver 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/sqlserverflex/v3alpha1api/model_instance_edition.go b/services/sqlserverflex/v3alpha1api/model_instance_edition.go new file mode 100644 index 000000000..c46bd7b86 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_instance_edition.go @@ -0,0 +1,113 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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" +) + +// InstanceEdition Edition of the MSSQL server instance +type InstanceEdition string + +// List of instance.edition +const ( + INSTANCEEDITION_STANDARD InstanceEdition = "Standard" + INSTANCEEDITION_ENTERPRISE_CORE InstanceEdition = "EnterpriseCore" + INSTANCEEDITION_DEVELOPER InstanceEdition = "developer" +) + +// All allowed values of InstanceEdition enum +var AllowedInstanceEditionEnumValues = []InstanceEdition{ + "Standard", + "EnterpriseCore", + "developer", +} + +func (v *InstanceEdition) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceEdition(value) + for _, existing := range AllowedInstanceEditionEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InstanceEdition", value) +} + +// NewInstanceEditionFromValue returns a pointer to a valid InstanceEdition +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceEditionFromValue(v string) (*InstanceEdition, error) { + ev := InstanceEdition(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceEdition: valid values are %v", v, AllowedInstanceEditionEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceEdition) IsValid() bool { + for _, existing := range AllowedInstanceEditionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to instance.edition value +func (v InstanceEdition) Ptr() *InstanceEdition { + return &v +} + +type NullableInstanceEdition struct { + value *InstanceEdition + isSet bool +} + +func (v NullableInstanceEdition) Get() *InstanceEdition { + return v.value +} + +func (v *NullableInstanceEdition) Set(val *InstanceEdition) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceEdition) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceEdition) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceEdition(val *InstanceEdition) *NullableInstanceEdition { + return &NullableInstanceEdition{value: val, isSet: true} +} + +func (v NullableInstanceEdition) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceEdition) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3alpha1api/model_instance_encryption.go b/services/sqlserverflex/v3alpha1api/model_instance_encryption.go new file mode 100644 index 000000000..d7c200a9e --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_instance_encryption.go @@ -0,0 +1,244 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 this defines which key to use for storage encryption +type InstanceEncryption struct { + // The key identifier + KekKeyId string `json:"kekKeyId"` + // The keyring identifier + KekKeyRingId string `json:"kekKeyRingId"` + // The 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/sqlserverflex/v3alpha1api/model_instance_network.go b/services/sqlserverflex/v3alpha1api/model_instance_network.go new file mode 100644 index 000000000..c8a0e15bc --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_instance_network.go @@ -0,0 +1,238 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 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,omitempty"` + InstanceAddress *string `json:"instanceAddress,omitempty"` + RouterAddress *string `json:"routerAddress,omitempty"` +} + +// 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() *InstanceNetwork { + this := InstanceNetwork{} + var accessScope InstanceNetworkAccessScope = INSTANCENETWORKACCESSSCOPE_PUBLIC + this.AccessScope = &accessScope + 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 if set, zero value otherwise. +func (o *InstanceNetwork) 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 *InstanceNetwork) 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 *InstanceNetwork) 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 *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 + } + if !IsNil(o.Acl) { + toSerialize["acl"] = o.Acl + } + if !IsNil(o.InstanceAddress) { + toSerialize["instanceAddress"] = o.InstanceAddress + } + if !IsNil(o.RouterAddress) { + toSerialize["routerAddress"] = o.RouterAddress + } + return toSerialize, nil +} + +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/sqlserverflex/v3alpha1api/model_instance_network_access_scope.go b/services/sqlserverflex/v3alpha1api/model_instance_network_access_scope.go new file mode 100644 index 000000000..5a2a75a3d --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_instance_network_access_scope.go @@ -0,0 +1,111 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 network access scope of the instance ⚠️ **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 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/sqlserverflex/v3alpha1api/model_instance_sort.go b/services/sqlserverflex/v3alpha1api/model_instance_sort.go new file mode 100644 index 000000000..0a2a317da --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_instance_sort.go @@ -0,0 +1,127 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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_INDEX_DESC InstanceSort = "index.desc" + INSTANCESORT_INDEX_ASC InstanceSort = "index.asc" + 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{ + "index.desc", + "index.asc", + "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/sqlserverflex/v3alpha1api/model_instance_version.go b/services/sqlserverflex/v3alpha1api/model_instance_version.go new file mode 100644 index 000000000..a2f694525 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_instance_version.go @@ -0,0 +1,109 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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" +) + +// InstanceVersion The sqlserver version used for the instance. +type InstanceVersion string + +// List of instance.version +const ( + INSTANCEVERSION__2022 InstanceVersion = "2022" +) + +// All allowed values of InstanceVersion enum +var AllowedInstanceVersionEnumValues = []InstanceVersion{ + "2022", +} + +func (v *InstanceVersion) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceVersion(value) + for _, existing := range AllowedInstanceVersionEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InstanceVersion", value) +} + +// NewInstanceVersionFromValue returns a pointer to a valid InstanceVersion +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceVersionFromValue(v string) (*InstanceVersion, error) { + ev := InstanceVersion(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceVersion: valid values are %v", v, AllowedInstanceVersionEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceVersion) IsValid() bool { + for _, existing := range AllowedInstanceVersionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to instance.version value +func (v InstanceVersion) Ptr() *InstanceVersion { + return &v +} + +type NullableInstanceVersion struct { + value *InstanceVersion + isSet bool +} + +func (v NullableInstanceVersion) Get() *InstanceVersion { + return v.value +} + +func (v *NullableInstanceVersion) Set(val *InstanceVersion) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceVersion) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceVersion) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceVersion(val *InstanceVersion) *NullableInstanceVersion { + return &NullableInstanceVersion{value: val, isSet: true} +} + +func (v NullableInstanceVersion) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceVersion) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3alpha1api/model_instance_version_opt.go b/services/sqlserverflex/v3alpha1api/model_instance_version_opt.go new file mode 100644 index 000000000..b891930b7 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_instance_version_opt.go @@ -0,0 +1,109 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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" +) + +// InstanceVersionOpt the model 'InstanceVersionOpt' +type InstanceVersionOpt string + +// List of instance.version.opt +const ( + INSTANCEVERSIONOPT__2022 InstanceVersionOpt = "2022" +) + +// All allowed values of InstanceVersionOpt enum +var AllowedInstanceVersionOptEnumValues = []InstanceVersionOpt{ + "2022", +} + +func (v *InstanceVersionOpt) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceVersionOpt(value) + for _, existing := range AllowedInstanceVersionOptEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InstanceVersionOpt", value) +} + +// NewInstanceVersionOptFromValue returns a pointer to a valid InstanceVersionOpt +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceVersionOptFromValue(v string) (*InstanceVersionOpt, error) { + ev := InstanceVersionOpt(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceVersionOpt: valid values are %v", v, AllowedInstanceVersionOptEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceVersionOpt) IsValid() bool { + for _, existing := range AllowedInstanceVersionOptEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to instance.version.opt value +func (v InstanceVersionOpt) Ptr() *InstanceVersionOpt { + return &v +} + +type NullableInstanceVersionOpt struct { + value *InstanceVersionOpt + isSet bool +} + +func (v NullableInstanceVersionOpt) Get() *InstanceVersionOpt { + return v.value +} + +func (v *NullableInstanceVersionOpt) Set(val *InstanceVersionOpt) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceVersionOpt) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceVersionOpt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceVersionOpt(val *InstanceVersionOpt) *NullableInstanceVersionOpt { + return &NullableInstanceVersionOpt{value: val, isSet: true} +} + +func (v NullableInstanceVersionOpt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceVersionOpt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3alpha1api/model_list_backup.go b/services/sqlserverflex/v3alpha1api/model_list_backup.go new file mode 100644 index 000000000..a03c27f74 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_list_backup.go @@ -0,0 +1,303 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 int64 `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 int64 `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 int64, name string, retainedUntil string, size int64, 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() int64 { + if o == nil { + var ret int64 + 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() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ListBackup) SetId(v int64) { + 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() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value +// and a boolean to check if the value has been set. +func (o *ListBackup) GetSizeOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value +func (o *ListBackup) SetSize(v int64) { + 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/sqlserverflex/v3alpha1api/model_list_backup_response.go b/services/sqlserverflex/v3alpha1api/model_list_backup_response.go new file mode 100644 index 000000000..7bebbdc83 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_list_backup_response.go @@ -0,0 +1,186 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 []ListBackupsResponse `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 []ListBackupsResponse, 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() []ListBackupsResponse { + if o == nil { + var ret []ListBackupsResponse + 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() ([]ListBackupsResponse, bool) { + if o == nil { + return nil, false + } + return o.Backups, true +} + +// SetBackups sets field value +func (o *ListBackupResponse) SetBackups(v []ListBackupsResponse) { + 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/sqlserverflex/v3alpha1api/model_list_backups_response.go b/services/sqlserverflex/v3alpha1api/model_list_backups_response.go new file mode 100644 index 000000000..91e9f8c92 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_list_backups_response.go @@ -0,0 +1,187 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 ListBackupsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListBackupsResponse{} + +// ListBackupsResponse struct for ListBackupsResponse +type ListBackupsResponse struct { + // List of the backups beloning to that database + Backups []ListBackup `json:"backups" validate:"required,dive"` + // Name of the database the backups belong to + DatabaseName string `json:"databaseName" validate:"required,databaseName"` +} + +type _ListBackupsResponse ListBackupsResponse + +// 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(backups []ListBackup, databaseName string) *ListBackupsResponse { + this := ListBackupsResponse{} + this.Backups = backups + this.DatabaseName = databaseName + 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 +} + +// GetBackups returns the Backups field value +func (o *ListBackupsResponse) 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 *ListBackupsResponse) GetBackupsOk() ([]ListBackup, bool) { + if o == nil { + return nil, false + } + return o.Backups, true +} + +// SetBackups sets field value +func (o *ListBackupsResponse) SetBackups(v []ListBackup) { + o.Backups = v +} + +// GetDatabaseName returns the DatabaseName field value +func (o *ListBackupsResponse) GetDatabaseName() string { + if o == nil { + var ret string + return ret + } + + return o.DatabaseName +} + +// GetDatabaseNameOk returns a tuple with the DatabaseName field value +// and a boolean to check if the value has been set. +func (o *ListBackupsResponse) GetDatabaseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DatabaseName, true +} + +// SetDatabaseName sets field value +func (o *ListBackupsResponse) SetDatabaseName(v string) { + o.DatabaseName = 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{}{} + toSerialize["backups"] = o.Backups + toSerialize["databaseName"] = o.DatabaseName + return toSerialize, nil +} + +func (o *ListBackupsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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", + "databaseName", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListBackupsResponse := _ListBackupsResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListBackupsResponse) + + if err != nil { + return err + } + + *o = ListBackupsResponse(varListBackupsResponse) + + return err +} + +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/sqlserverflex/v3alpha1api/model_list_compatibility_response.go b/services/sqlserverflex/v3alpha1api/model_list_compatibility_response.go new file mode 100644 index 000000000..58606d34b --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_list_compatibility_response.go @@ -0,0 +1,158 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 ListCompatibilityResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListCompatibilityResponse{} + +// ListCompatibilityResponse struct for ListCompatibilityResponse +type ListCompatibilityResponse struct { + // List of compatibilities available for a d + Compatibilities []DatabaseGetcompatibility `json:"compatibilities"` +} + +type _ListCompatibilityResponse ListCompatibilityResponse + +// NewListCompatibilityResponse instantiates a new ListCompatibilityResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListCompatibilityResponse(compatibilities []DatabaseGetcompatibility) *ListCompatibilityResponse { + this := ListCompatibilityResponse{} + this.Compatibilities = compatibilities + return &this +} + +// NewListCompatibilityResponseWithDefaults instantiates a new ListCompatibilityResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListCompatibilityResponseWithDefaults() *ListCompatibilityResponse { + this := ListCompatibilityResponse{} + return &this +} + +// GetCompatibilities returns the Compatibilities field value +func (o *ListCompatibilityResponse) GetCompatibilities() []DatabaseGetcompatibility { + if o == nil { + var ret []DatabaseGetcompatibility + return ret + } + + return o.Compatibilities +} + +// GetCompatibilitiesOk returns a tuple with the Compatibilities field value +// and a boolean to check if the value has been set. +func (o *ListCompatibilityResponse) GetCompatibilitiesOk() ([]DatabaseGetcompatibility, bool) { + if o == nil { + return nil, false + } + return o.Compatibilities, true +} + +// SetCompatibilities sets field value +func (o *ListCompatibilityResponse) SetCompatibilities(v []DatabaseGetcompatibility) { + o.Compatibilities = v +} + +func (o ListCompatibilityResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListCompatibilityResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["compatibilities"] = o.Compatibilities + return toSerialize, nil +} + +func (o *ListCompatibilityResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "compatibilities", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListCompatibilityResponse := _ListCompatibilityResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListCompatibilityResponse) + + if err != nil { + return err + } + + *o = ListCompatibilityResponse(varListCompatibilityResponse) + + return err +} + +type NullableListCompatibilityResponse struct { + value *ListCompatibilityResponse + isSet bool +} + +func (v NullableListCompatibilityResponse) Get() *ListCompatibilityResponse { + return v.value +} + +func (v *NullableListCompatibilityResponse) Set(val *ListCompatibilityResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListCompatibilityResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListCompatibilityResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListCompatibilityResponse(val *ListCompatibilityResponse) *NullableListCompatibilityResponse { + return &NullableListCompatibilityResponse{value: val, isSet: true} +} + +func (v NullableListCompatibilityResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListCompatibilityResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3alpha1api/model_list_current_running_restore_jobs.go b/services/sqlserverflex/v3alpha1api/model_list_current_running_restore_jobs.go new file mode 100644 index 000000000..c7850408d --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_list_current_running_restore_jobs.go @@ -0,0 +1,158 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 ListCurrentRunningRestoreJobs type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListCurrentRunningRestoreJobs{} + +// ListCurrentRunningRestoreJobs struct for ListCurrentRunningRestoreJobs +type ListCurrentRunningRestoreJobs struct { + // List of the currently running Restore jobs + RunningRestores []BackupRunningRestore `json:"runningRestores"` +} + +type _ListCurrentRunningRestoreJobs ListCurrentRunningRestoreJobs + +// NewListCurrentRunningRestoreJobs instantiates a new ListCurrentRunningRestoreJobs object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListCurrentRunningRestoreJobs(runningRestores []BackupRunningRestore) *ListCurrentRunningRestoreJobs { + this := ListCurrentRunningRestoreJobs{} + this.RunningRestores = runningRestores + return &this +} + +// NewListCurrentRunningRestoreJobsWithDefaults instantiates a new ListCurrentRunningRestoreJobs object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListCurrentRunningRestoreJobsWithDefaults() *ListCurrentRunningRestoreJobs { + this := ListCurrentRunningRestoreJobs{} + return &this +} + +// GetRunningRestores returns the RunningRestores field value +func (o *ListCurrentRunningRestoreJobs) GetRunningRestores() []BackupRunningRestore { + if o == nil { + var ret []BackupRunningRestore + return ret + } + + return o.RunningRestores +} + +// GetRunningRestoresOk returns a tuple with the RunningRestores field value +// and a boolean to check if the value has been set. +func (o *ListCurrentRunningRestoreJobs) GetRunningRestoresOk() ([]BackupRunningRestore, bool) { + if o == nil { + return nil, false + } + return o.RunningRestores, true +} + +// SetRunningRestores sets field value +func (o *ListCurrentRunningRestoreJobs) SetRunningRestores(v []BackupRunningRestore) { + o.RunningRestores = v +} + +func (o ListCurrentRunningRestoreJobs) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListCurrentRunningRestoreJobs) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["runningRestores"] = o.RunningRestores + return toSerialize, nil +} + +func (o *ListCurrentRunningRestoreJobs) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "runningRestores", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListCurrentRunningRestoreJobs := _ListCurrentRunningRestoreJobs{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListCurrentRunningRestoreJobs) + + if err != nil { + return err + } + + *o = ListCurrentRunningRestoreJobs(varListCurrentRunningRestoreJobs) + + return err +} + +type NullableListCurrentRunningRestoreJobs struct { + value *ListCurrentRunningRestoreJobs + isSet bool +} + +func (v NullableListCurrentRunningRestoreJobs) Get() *ListCurrentRunningRestoreJobs { + return v.value +} + +func (v *NullableListCurrentRunningRestoreJobs) Set(val *ListCurrentRunningRestoreJobs) { + v.value = val + v.isSet = true +} + +func (v NullableListCurrentRunningRestoreJobs) IsSet() bool { + return v.isSet +} + +func (v *NullableListCurrentRunningRestoreJobs) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListCurrentRunningRestoreJobs(val *ListCurrentRunningRestoreJobs) *NullableListCurrentRunningRestoreJobs { + return &NullableListCurrentRunningRestoreJobs{value: val, isSet: true} +} + +func (v NullableListCurrentRunningRestoreJobs) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListCurrentRunningRestoreJobs) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3alpha1api/model_list_database.go b/services/sqlserverflex/v3alpha1api/model_list_database.go new file mode 100644 index 000000000..b8724daae --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_list_database.go @@ -0,0 +1,245 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 date when the database was created in RFC3339 format. + Created string `json:"created"` + // The id of the database. + Id int64 `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(created string, id int64, name string, owner string) *ListDatabase { + this := ListDatabase{} + this.Created = created + 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 +} + +// GetCreated returns the Created field value +func (o *ListDatabase) GetCreated() string { + if o == nil { + var ret string + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *ListDatabase) GetCreatedOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *ListDatabase) SetCreated(v string) { + o.Created = v +} + +// GetId returns the Id field value +func (o *ListDatabase) GetId() int64 { + if o == nil { + var ret int64 + 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() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ListDatabase) SetId(v int64) { + 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["created"] = o.Created + 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{ + "created", + "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/sqlserverflex/v3alpha1api/model_list_databases_response.go b/services/sqlserverflex/v3alpha1api/model_list_databases_response.go new file mode 100644 index 000000000..e7c44a97c --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_list_databases_response.go @@ -0,0 +1,186 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v3alpha1api/model_list_flavors.go b/services/sqlserverflex/v3alpha1api/model_list_flavors.go new file mode 100644 index 000000000..0da619cca --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_list_flavors.go @@ -0,0 +1,361 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 int64 `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 int64 `json:"memory"` + // minimum storage which is required to order in Gigabyte. + MinGB int32 `json:"minGB"` + // defines the nodeType it can be either single or HA + 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 int64, description string, id string, maxGB int32, memory int64, 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() int64 { + if o == nil { + var ret int64 + 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() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Cpu, true +} + +// SetCpu sets field value +func (o *ListFlavors) SetCpu(v int64) { + 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() int64 { + if o == nil { + var ret int64 + 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() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Memory, true +} + +// SetMemory sets field value +func (o *ListFlavors) SetMemory(v int64) { + 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/sqlserverflex/v3alpha1api/model_list_instance.go b/services/sqlserverflex/v3alpha1api/model_list_instance.go new file mode 100644 index 000000000..2dfff2f6e --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_list_instance.go @@ -0,0 +1,244 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v3alpha1api/model_list_instances_response.go b/services/sqlserverflex/v3alpha1api/model_list_instances_response.go new file mode 100644 index 000000000..cc0d39c2a --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_list_instances_response.go @@ -0,0 +1,186 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v3alpha1api/model_list_roles_response.go b/services/sqlserverflex/v3alpha1api/model_list_roles_response.go new file mode 100644 index 000000000..dcc7636ce --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_list_roles_response.go @@ -0,0 +1,158 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 roles available for an 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/sqlserverflex/v3alpha1api/model_list_user.go b/services/sqlserverflex/v3alpha1api/model_list_user.go new file mode 100644 index 000000000..1c6c804db --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_list_user.go @@ -0,0 +1,216 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 int64 `json:"id"` + // The current status of the user. + Status string `json:"status"` + // The name of the user. + Username string `json:"username"` +} + +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 int64, status string, username string) *ListUser { + this := ListUser{} + this.Id = id + this.Status = status + this.Username = username + 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() int64 { + if o == nil { + var ret int64 + 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() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ListUser) SetId(v int64) { + o.Id = 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 +} + +// GetUsername returns the Username field value +func (o *ListUser) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *ListUser) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *ListUser) SetUsername(v string) { + o.Username = 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["status"] = o.Status + toSerialize["username"] = o.Username + 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", + "status", + "username", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if 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/sqlserverflex/v3alpha1api/model_list_user_response.go b/services/sqlserverflex/v3alpha1api/model_list_user_response.go new file mode 100644 index 000000000..4003d7bd6 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_list_user_response.go @@ -0,0 +1,186 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v3alpha1api/model_pagination.go b/services/sqlserverflex/v3alpha1api/model_pagination.go new file mode 100644 index 000000000..ce84009d1 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_pagination.go @@ -0,0 +1,269 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 int64 `json:"page" validate:"required"` + Size int64 `json:"size" validate:"required"` + Sort string `json:"sort" validate:"required"` + TotalPages int64 `json:"totalPages" validate:"required"` + TotalRows int64 `json:"totalRows" validate:"required"` +} + +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 int64, size int64, sort string, totalPages int64, totalRows int64) *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() int64 { + if o == nil { + var ret int64 + 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() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Page, true +} + +// SetPage sets field value +func (o *Pagination) SetPage(v int64) { + o.Page = v +} + +// GetSize returns the Size field value +func (o *Pagination) GetSize() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value +// and a boolean to check if the value has been set. +func (o *Pagination) GetSizeOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value +func (o *Pagination) SetSize(v int64) { + 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() int64 { + if o == nil { + var ret int64 + 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() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.TotalPages, true +} + +// SetTotalPages sets field value +func (o *Pagination) SetTotalPages(v int64) { + o.TotalPages = v +} + +// GetTotalRows returns the TotalRows field value +func (o *Pagination) GetTotalRows() int64 { + if o == nil { + var ret int64 + 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() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.TotalRows, true +} + +// SetTotalRows sets field value +func (o *Pagination) SetTotalRows(v int64) { + 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/sqlserverflex/v3alpha1api/model_protect_instance_request_payload.go b/services/sqlserverflex/v3alpha1api/model_protect_instance_request_payload.go new file mode 100644 index 000000000..61f161d75 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_protect_instance_request_payload.go @@ -0,0 +1,158 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v3alpha1api/model_protect_instance_response.go b/services/sqlserverflex/v3alpha1api/model_protect_instance_response.go new file mode 100644 index 000000000..968eafe8b --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_protect_instance_response.go @@ -0,0 +1,158 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v3alpha1api/model_replicas.go b/services/sqlserverflex/v3alpha1api/model_replicas.go new file mode 100644 index 000000000..f792d8f5e --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_replicas.go @@ -0,0 +1,111 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 int32 + +// 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 int32 + 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 int32) (*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/sqlserverflex/v3alpha1api/model_replicas_opt.go b/services/sqlserverflex/v3alpha1api/model_replicas_opt.go new file mode 100644 index 000000000..07adcb409 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_replicas_opt.go @@ -0,0 +1,111 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 int32 + +// 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 int32 + 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 int32) (*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/sqlserverflex/v3alpha1api/model_reset_user_response.go b/services/sqlserverflex/v3alpha1api/model_reset_user_response.go new file mode 100644 index 000000000..abe382f72 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_reset_user_response.go @@ -0,0 +1,245 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 password for the user. + Password string `json:"password"` + // The current status of the user. + Status string `json:"status"` + // The connection string for the user to the instance. + Uri string `json:"uri"` + // The name of the user. + Username string `json:"username"` +} + +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(password string, status string, uri string, username string) *ResetUserResponse { + this := ResetUserResponse{} + this.Password = password + this.Status = status + this.Uri = uri + this.Username = username + 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 +} + +// 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 +} + +// GetUri returns the Uri field value +func (o *ResetUserResponse) GetUri() string { + if o == nil { + var ret string + return ret + } + + return o.Uri +} + +// GetUriOk returns a tuple with the Uri field value +// and a boolean to check if the value has been set. +func (o *ResetUserResponse) GetUriOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Uri, true +} + +// SetUri sets field value +func (o *ResetUserResponse) SetUri(v string) { + o.Uri = v +} + +// GetUsername returns the Username field value +func (o *ResetUserResponse) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *ResetUserResponse) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *ResetUserResponse) SetUsername(v string) { + o.Username = 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["password"] = o.Password + toSerialize["status"] = o.Status + toSerialize["uri"] = o.Uri + toSerialize["username"] = o.Username + 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{ + "password", + "status", + "uri", + "username", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if 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/sqlserverflex/v3alpha1api/model_restore_database_from_backup_payload.go b/services/sqlserverflex/v3alpha1api/model_restore_database_from_backup_payload.go new file mode 100644 index 000000000..ffcb41059 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_restore_database_from_backup_payload.go @@ -0,0 +1,186 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 RestoreDatabaseFromBackupPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RestoreDatabaseFromBackupPayload{} + +// RestoreDatabaseFromBackupPayload Request to restore a database. +type RestoreDatabaseFromBackupPayload struct { + // The name of the database on the instance to be restore. + DatabaseName string `json:"database_name"` + Source RestoreDatabaseFromBackupPayloadSource `json:"source"` +} + +type _RestoreDatabaseFromBackupPayload RestoreDatabaseFromBackupPayload + +// NewRestoreDatabaseFromBackupPayload instantiates a new RestoreDatabaseFromBackupPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRestoreDatabaseFromBackupPayload(databaseName string, source RestoreDatabaseFromBackupPayloadSource) *RestoreDatabaseFromBackupPayload { + this := RestoreDatabaseFromBackupPayload{} + this.DatabaseName = databaseName + this.Source = source + return &this +} + +// NewRestoreDatabaseFromBackupPayloadWithDefaults instantiates a new RestoreDatabaseFromBackupPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRestoreDatabaseFromBackupPayloadWithDefaults() *RestoreDatabaseFromBackupPayload { + this := RestoreDatabaseFromBackupPayload{} + return &this +} + +// GetDatabaseName returns the DatabaseName field value +func (o *RestoreDatabaseFromBackupPayload) GetDatabaseName() string { + if o == nil { + var ret string + return ret + } + + return o.DatabaseName +} + +// GetDatabaseNameOk returns a tuple with the DatabaseName field value +// and a boolean to check if the value has been set. +func (o *RestoreDatabaseFromBackupPayload) GetDatabaseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DatabaseName, true +} + +// SetDatabaseName sets field value +func (o *RestoreDatabaseFromBackupPayload) SetDatabaseName(v string) { + o.DatabaseName = v +} + +// GetSource returns the Source field value +func (o *RestoreDatabaseFromBackupPayload) GetSource() RestoreDatabaseFromBackupPayloadSource { + if o == nil { + var ret RestoreDatabaseFromBackupPayloadSource + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *RestoreDatabaseFromBackupPayload) GetSourceOk() (*RestoreDatabaseFromBackupPayloadSource, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *RestoreDatabaseFromBackupPayload) SetSource(v RestoreDatabaseFromBackupPayloadSource) { + o.Source = v +} + +func (o RestoreDatabaseFromBackupPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RestoreDatabaseFromBackupPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["database_name"] = o.DatabaseName + toSerialize["source"] = o.Source + return toSerialize, nil +} + +func (o *RestoreDatabaseFromBackupPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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_name", + "source", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRestoreDatabaseFromBackupPayload := _RestoreDatabaseFromBackupPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRestoreDatabaseFromBackupPayload) + + if err != nil { + return err + } + + *o = RestoreDatabaseFromBackupPayload(varRestoreDatabaseFromBackupPayload) + + return err +} + +type NullableRestoreDatabaseFromBackupPayload struct { + value *RestoreDatabaseFromBackupPayload + isSet bool +} + +func (v NullableRestoreDatabaseFromBackupPayload) Get() *RestoreDatabaseFromBackupPayload { + return v.value +} + +func (v *NullableRestoreDatabaseFromBackupPayload) Set(val *RestoreDatabaseFromBackupPayload) { + v.value = val + v.isSet = true +} + +func (v NullableRestoreDatabaseFromBackupPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableRestoreDatabaseFromBackupPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRestoreDatabaseFromBackupPayload(val *RestoreDatabaseFromBackupPayload) *NullableRestoreDatabaseFromBackupPayload { + return &NullableRestoreDatabaseFromBackupPayload{value: val, isSet: true} +} + +func (v NullableRestoreDatabaseFromBackupPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRestoreDatabaseFromBackupPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3alpha1api/model_restore_database_from_backup_payload_source.go b/services/sqlserverflex/v3alpha1api/model_restore_database_from_backup_payload_source.go new file mode 100644 index 000000000..4eedc18da --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_restore_database_from_backup_payload_source.go @@ -0,0 +1,154 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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" +) + +// RestoreDatabaseFromBackupPayloadSource - The source of the restore. +type RestoreDatabaseFromBackupPayloadSource struct { + SourceBackup *SourceBackup + SourceExternalS3 *SourceExternalS3 +} + +// SourceBackupAsRestoreDatabaseFromBackupPayloadSource is a convenience function that returns SourceBackup wrapped in RestoreDatabaseFromBackupPayloadSource +func SourceBackupAsRestoreDatabaseFromBackupPayloadSource(v *SourceBackup) RestoreDatabaseFromBackupPayloadSource { + return RestoreDatabaseFromBackupPayloadSource{ + SourceBackup: v, + } +} + +// SourceExternalS3AsRestoreDatabaseFromBackupPayloadSource is a convenience function that returns SourceExternalS3 wrapped in RestoreDatabaseFromBackupPayloadSource +func SourceExternalS3AsRestoreDatabaseFromBackupPayloadSource(v *SourceExternalS3) RestoreDatabaseFromBackupPayloadSource { + return RestoreDatabaseFromBackupPayloadSource{ + SourceExternalS3: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *RestoreDatabaseFromBackupPayloadSource) UnmarshalJSON(data []byte) error { + var err error + // use discriminator value to speed up the lookup + var jsonDict map[string]interface{} + err = newStrictDecoder(data).Decode(&jsonDict) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") + } + + // check if the discriminator value is 'BACKUP' + if jsonDict["type"] == "BACKUP" { + // try to unmarshal JSON data into SourceBackup + err = json.Unmarshal(data, &dst.SourceBackup) + if err == nil { + return nil // data stored in dst.SourceBackup, return on the first match + } else { + dst.SourceBackup = nil + return fmt.Errorf("failed to unmarshal RestoreDatabaseFromBackupPayloadSource as SourceBackup: %s", err.Error()) + } + } + + // check if the discriminator value is 'EXTERNAL_S3' + if jsonDict["type"] == "EXTERNAL_S3" { + // try to unmarshal JSON data into SourceExternalS3 + err = json.Unmarshal(data, &dst.SourceExternalS3) + if err == nil { + return nil // data stored in dst.SourceExternalS3, return on the first match + } else { + dst.SourceExternalS3 = nil + return fmt.Errorf("failed to unmarshal RestoreDatabaseFromBackupPayloadSource as SourceExternalS3: %s", err.Error()) + } + } + + return nil +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src RestoreDatabaseFromBackupPayloadSource) MarshalJSON() ([]byte, error) { + if src.SourceBackup != nil { + return json.Marshal(&src.SourceBackup) + } + + if src.SourceExternalS3 != nil { + return json.Marshal(&src.SourceExternalS3) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *RestoreDatabaseFromBackupPayloadSource) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.SourceBackup != nil { + return obj.SourceBackup + } + + if obj.SourceExternalS3 != nil { + return obj.SourceExternalS3 + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj RestoreDatabaseFromBackupPayloadSource) GetActualInstanceValue() interface{} { + if obj.SourceBackup != nil { + return *obj.SourceBackup + } + + if obj.SourceExternalS3 != nil { + return *obj.SourceExternalS3 + } + + // all schemas are nil + return nil +} + +type NullableRestoreDatabaseFromBackupPayloadSource struct { + value *RestoreDatabaseFromBackupPayloadSource + isSet bool +} + +func (v NullableRestoreDatabaseFromBackupPayloadSource) Get() *RestoreDatabaseFromBackupPayloadSource { + return v.value +} + +func (v *NullableRestoreDatabaseFromBackupPayloadSource) Set(val *RestoreDatabaseFromBackupPayloadSource) { + v.value = val + v.isSet = true +} + +func (v NullableRestoreDatabaseFromBackupPayloadSource) IsSet() bool { + return v.isSet +} + +func (v *NullableRestoreDatabaseFromBackupPayloadSource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRestoreDatabaseFromBackupPayloadSource(val *RestoreDatabaseFromBackupPayloadSource) *NullableRestoreDatabaseFromBackupPayloadSource { + return &NullableRestoreDatabaseFromBackupPayloadSource{value: val, isSet: true} +} + +func (v NullableRestoreDatabaseFromBackupPayloadSource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRestoreDatabaseFromBackupPayloadSource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3alpha1api/model_s3file_info.go b/services/sqlserverflex/v3alpha1api/model_s3file_info.go new file mode 100644 index 000000000..3dd9709c3 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_s3file_info.go @@ -0,0 +1,163 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 S3fileInfo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &S3fileInfo{} + +// S3fileInfo struct for S3fileInfo +type S3fileInfo struct { + // The sequence number of the file + FileNumber *int32 `json:"file_number,omitempty"` + // The path to the file on the S3 bucket + FilePath *string `json:"file_path,omitempty"` +} + +// NewS3fileInfo instantiates a new S3fileInfo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewS3fileInfo() *S3fileInfo { + this := S3fileInfo{} + return &this +} + +// NewS3fileInfoWithDefaults instantiates a new S3fileInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewS3fileInfoWithDefaults() *S3fileInfo { + this := S3fileInfo{} + return &this +} + +// GetFileNumber returns the FileNumber field value if set, zero value otherwise. +func (o *S3fileInfo) GetFileNumber() int32 { + if o == nil || IsNil(o.FileNumber) { + var ret int32 + return ret + } + return *o.FileNumber +} + +// GetFileNumberOk returns a tuple with the FileNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *S3fileInfo) GetFileNumberOk() (*int32, bool) { + if o == nil || IsNil(o.FileNumber) { + return nil, false + } + return o.FileNumber, true +} + +// HasFileNumber returns a boolean if a field has been set. +func (o *S3fileInfo) HasFileNumber() bool { + if o != nil && !IsNil(o.FileNumber) { + return true + } + + return false +} + +// SetFileNumber gets a reference to the given int32 and assigns it to the FileNumber field. +func (o *S3fileInfo) SetFileNumber(v int32) { + o.FileNumber = &v +} + +// GetFilePath returns the FilePath field value if set, zero value otherwise. +func (o *S3fileInfo) GetFilePath() string { + if o == nil || IsNil(o.FilePath) { + var ret string + return ret + } + return *o.FilePath +} + +// GetFilePathOk returns a tuple with the FilePath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *S3fileInfo) GetFilePathOk() (*string, bool) { + if o == nil || IsNil(o.FilePath) { + return nil, false + } + return o.FilePath, true +} + +// HasFilePath returns a boolean if a field has been set. +func (o *S3fileInfo) HasFilePath() bool { + if o != nil && !IsNil(o.FilePath) { + return true + } + + return false +} + +// SetFilePath gets a reference to the given string and assigns it to the FilePath field. +func (o *S3fileInfo) SetFilePath(v string) { + o.FilePath = &v +} + +func (o S3fileInfo) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o S3fileInfo) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.FileNumber) { + toSerialize["file_number"] = o.FileNumber + } + if !IsNil(o.FilePath) { + toSerialize["file_path"] = o.FilePath + } + return toSerialize, nil +} + +type NullableS3fileInfo struct { + value *S3fileInfo + isSet bool +} + +func (v NullableS3fileInfo) Get() *S3fileInfo { + return v.value +} + +func (v *NullableS3fileInfo) Set(val *S3fileInfo) { + v.value = val + v.isSet = true +} + +func (v NullableS3fileInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableS3fileInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableS3fileInfo(val *S3fileInfo) *NullableS3fileInfo { + return &NullableS3fileInfo{value: val, isSet: true} +} + +func (v NullableS3fileInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableS3fileInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3alpha1api/model_source_backup.go b/services/sqlserverflex/v3alpha1api/model_source_backup.go new file mode 100644 index 000000000..bc253d396 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_source_backup.go @@ -0,0 +1,157 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 SourceBackup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SourceBackup{} + +// SourceBackup Restore from an existing managed backup. +type SourceBackup struct { + Type string `json:"type"` +} + +type _SourceBackup SourceBackup + +// NewSourceBackup instantiates a new SourceBackup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSourceBackup(types string) *SourceBackup { + this := SourceBackup{} + this.Type = types + return &this +} + +// NewSourceBackupWithDefaults instantiates a new SourceBackup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSourceBackupWithDefaults() *SourceBackup { + this := SourceBackup{} + return &this +} + +// GetType returns the Type field value +func (o *SourceBackup) 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 *SourceBackup) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *SourceBackup) SetType(v string) { + o.Type = v +} + +func (o SourceBackup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SourceBackup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *SourceBackup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSourceBackup := _SourceBackup{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varSourceBackup) + + if err != nil { + return err + } + + *o = SourceBackup(varSourceBackup) + + return err +} + +type NullableSourceBackup struct { + value *SourceBackup + isSet bool +} + +func (v NullableSourceBackup) Get() *SourceBackup { + return v.value +} + +func (v *NullableSourceBackup) Set(val *SourceBackup) { + v.value = val + v.isSet = true +} + +func (v NullableSourceBackup) IsSet() bool { + return v.isSet +} + +func (v *NullableSourceBackup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSourceBackup(val *SourceBackup) *NullableSourceBackup { + return &NullableSourceBackup{value: val, isSet: true} +} + +func (v NullableSourceBackup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSourceBackup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3alpha1api/model_source_external_s3.go b/services/sqlserverflex/v3alpha1api/model_source_external_s3.go new file mode 100644 index 000000000..8416eef58 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_source_external_s3.go @@ -0,0 +1,251 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 SourceExternalS3 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SourceExternalS3{} + +// SourceExternalS3 Restore from an external S3 backup file. +type SourceExternalS3 struct { + // The owner of the database. + DatabaseOwner string `json:"database_owner"` + // Logging guid to have a complete activity log over all sub stored procedures. + LoggingGuid *string `json:"logging_guid,omitempty"` + S3Details ExternalS3 `json:"s3_details"` + Type string `json:"type"` +} + +type _SourceExternalS3 SourceExternalS3 + +// NewSourceExternalS3 instantiates a new SourceExternalS3 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSourceExternalS3(databaseOwner string, s3Details ExternalS3, types string) *SourceExternalS3 { + this := SourceExternalS3{} + this.DatabaseOwner = databaseOwner + this.S3Details = s3Details + this.Type = types + return &this +} + +// NewSourceExternalS3WithDefaults instantiates a new SourceExternalS3 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSourceExternalS3WithDefaults() *SourceExternalS3 { + this := SourceExternalS3{} + return &this +} + +// GetDatabaseOwner returns the DatabaseOwner field value +func (o *SourceExternalS3) GetDatabaseOwner() string { + if o == nil { + var ret string + return ret + } + + return o.DatabaseOwner +} + +// GetDatabaseOwnerOk returns a tuple with the DatabaseOwner field value +// and a boolean to check if the value has been set. +func (o *SourceExternalS3) GetDatabaseOwnerOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DatabaseOwner, true +} + +// SetDatabaseOwner sets field value +func (o *SourceExternalS3) SetDatabaseOwner(v string) { + o.DatabaseOwner = v +} + +// GetLoggingGuid returns the LoggingGuid field value if set, zero value otherwise. +func (o *SourceExternalS3) GetLoggingGuid() string { + if o == nil || IsNil(o.LoggingGuid) { + var ret string + return ret + } + return *o.LoggingGuid +} + +// GetLoggingGuidOk returns a tuple with the LoggingGuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SourceExternalS3) GetLoggingGuidOk() (*string, bool) { + if o == nil || IsNil(o.LoggingGuid) { + return nil, false + } + return o.LoggingGuid, true +} + +// HasLoggingGuid returns a boolean if a field has been set. +func (o *SourceExternalS3) HasLoggingGuid() bool { + if o != nil && !IsNil(o.LoggingGuid) { + return true + } + + return false +} + +// SetLoggingGuid gets a reference to the given string and assigns it to the LoggingGuid field. +func (o *SourceExternalS3) SetLoggingGuid(v string) { + o.LoggingGuid = &v +} + +// GetS3Details returns the S3Details field value +func (o *SourceExternalS3) GetS3Details() ExternalS3 { + if o == nil { + var ret ExternalS3 + return ret + } + + return o.S3Details +} + +// GetS3DetailsOk returns a tuple with the S3Details field value +// and a boolean to check if the value has been set. +func (o *SourceExternalS3) GetS3DetailsOk() (*ExternalS3, bool) { + if o == nil { + return nil, false + } + return &o.S3Details, true +} + +// SetS3Details sets field value +func (o *SourceExternalS3) SetS3Details(v ExternalS3) { + o.S3Details = v +} + +// GetType returns the Type field value +func (o *SourceExternalS3) 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 *SourceExternalS3) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *SourceExternalS3) SetType(v string) { + o.Type = v +} + +func (o SourceExternalS3) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SourceExternalS3) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["database_owner"] = o.DatabaseOwner + if !IsNil(o.LoggingGuid) { + toSerialize["logging_guid"] = o.LoggingGuid + } + toSerialize["s3_details"] = o.S3Details + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *SourceExternalS3) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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_owner", + "s3_details", + "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) + } + } + + varSourceExternalS3 := _SourceExternalS3{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varSourceExternalS3) + + if err != nil { + return err + } + + *o = SourceExternalS3(varSourceExternalS3) + + return err +} + +type NullableSourceExternalS3 struct { + value *SourceExternalS3 + isSet bool +} + +func (v NullableSourceExternalS3) Get() *SourceExternalS3 { + return v.value +} + +func (v *NullableSourceExternalS3) Set(val *SourceExternalS3) { + v.value = val + v.isSet = true +} + +func (v NullableSourceExternalS3) IsSet() bool { + return v.isSet +} + +func (v *NullableSourceExternalS3) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSourceExternalS3(val *SourceExternalS3) *NullableSourceExternalS3 { + return &NullableSourceExternalS3{value: val, isSet: true} +} + +func (v NullableSourceExternalS3) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSourceExternalS3) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3alpha1api/model_status.go b/services/sqlserverflex/v3alpha1api/model_status.go new file mode 100644 index 000000000..64d7d209a --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_status.go @@ -0,0 +1,119 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 model 'Status' +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/sqlserverflex/v3alpha1api/model_storage.go b/services/sqlserverflex/v3alpha1api/model_storage.go new file mode 100644 index 000000000..2954d0c87 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_storage.go @@ -0,0 +1,163 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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. + Class *string `json:"class,omitempty"` + // The storage size in Gigabytes. + 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/sqlserverflex/v3alpha1api/model_storage_create.go b/services/sqlserverflex/v3alpha1api/model_storage_create.go new file mode 100644 index 000000000..a3a0a0d05 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_storage_create.go @@ -0,0 +1,187 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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. + Class string `json:"class"` + // The storage size in Gigabytes. + Size int64 `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(class string, size int64) *StorageCreate { + this := StorageCreate{} + this.Class = class + 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 +} + +// GetClass returns the Class field value +func (o *StorageCreate) 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 *StorageCreate) GetClassOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Class, true +} + +// SetClass sets field value +func (o *StorageCreate) SetClass(v string) { + o.Class = v +} + +// GetSize returns the Size field value +func (o *StorageCreate) GetSize() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value +// and a boolean to check if the value has been set. +func (o *StorageCreate) GetSizeOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value +func (o *StorageCreate) SetSize(v int64) { + 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["class"] = o.Class + 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{ + "class", + "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/sqlserverflex/v3alpha1api/model_storage_update.go b/services/sqlserverflex/v3alpha1api/model_storage_update.go new file mode 100644 index 000000000..8e943c639 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_storage_update.go @@ -0,0 +1,126 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 *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 +} + +// 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.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/sqlserverflex/v3alpha1api/model_trigger_restore_request_payload.go b/services/sqlserverflex/v3alpha1api/model_trigger_restore_request_payload.go new file mode 100644 index 000000000..d2ce702b8 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_trigger_restore_request_payload.go @@ -0,0 +1,187 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 TriggerRestoreRequestPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TriggerRestoreRequestPayload{} + +// TriggerRestoreRequestPayload struct for TriggerRestoreRequestPayload +type TriggerRestoreRequestPayload struct { + // The name of the database. + Name string `json:"name"` + // the time for the restore it will be calculated between first backup and last backup + RestoreDateTime string `json:"restoreDateTime"` +} + +type _TriggerRestoreRequestPayload TriggerRestoreRequestPayload + +// NewTriggerRestoreRequestPayload instantiates a new TriggerRestoreRequestPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTriggerRestoreRequestPayload(name string, restoreDateTime string) *TriggerRestoreRequestPayload { + this := TriggerRestoreRequestPayload{} + this.Name = name + this.RestoreDateTime = restoreDateTime + return &this +} + +// NewTriggerRestoreRequestPayloadWithDefaults instantiates a new TriggerRestoreRequestPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTriggerRestoreRequestPayloadWithDefaults() *TriggerRestoreRequestPayload { + this := TriggerRestoreRequestPayload{} + return &this +} + +// GetName returns the Name field value +func (o *TriggerRestoreRequestPayload) 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 *TriggerRestoreRequestPayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *TriggerRestoreRequestPayload) SetName(v string) { + o.Name = v +} + +// GetRestoreDateTime returns the RestoreDateTime field value +func (o *TriggerRestoreRequestPayload) GetRestoreDateTime() string { + if o == nil { + var ret string + return ret + } + + return o.RestoreDateTime +} + +// GetRestoreDateTimeOk returns a tuple with the RestoreDateTime field value +// and a boolean to check if the value has been set. +func (o *TriggerRestoreRequestPayload) GetRestoreDateTimeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RestoreDateTime, true +} + +// SetRestoreDateTime sets field value +func (o *TriggerRestoreRequestPayload) SetRestoreDateTime(v string) { + o.RestoreDateTime = v +} + +func (o TriggerRestoreRequestPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TriggerRestoreRequestPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["restoreDateTime"] = o.RestoreDateTime + return toSerialize, nil +} + +func (o *TriggerRestoreRequestPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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", + "restoreDateTime", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTriggerRestoreRequestPayload := _TriggerRestoreRequestPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varTriggerRestoreRequestPayload) + + if err != nil { + return err + } + + *o = TriggerRestoreRequestPayload(varTriggerRestoreRequestPayload) + + return err +} + +type NullableTriggerRestoreRequestPayload struct { + value *TriggerRestoreRequestPayload + isSet bool +} + +func (v NullableTriggerRestoreRequestPayload) Get() *TriggerRestoreRequestPayload { + return v.value +} + +func (v *NullableTriggerRestoreRequestPayload) Set(val *TriggerRestoreRequestPayload) { + v.value = val + v.isSet = true +} + +func (v NullableTriggerRestoreRequestPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableTriggerRestoreRequestPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTriggerRestoreRequestPayload(val *TriggerRestoreRequestPayload) *NullableTriggerRestoreRequestPayload { + return &NullableTriggerRestoreRequestPayload{value: val, isSet: true} +} + +func (v NullableTriggerRestoreRequestPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTriggerRestoreRequestPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3alpha1api/model_update_instance_partially_request_payload.go b/services/sqlserverflex/v3alpha1api/model_update_instance_partially_request_payload.go new file mode 100644 index 000000000..af6ef65e6 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_update_instance_partially_request_payload.go @@ -0,0 +1,380 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 on what time and how often the database backup will be created. 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 *UpdateInstancePartiallyRequestPayloadNetwork `json:"network,omitempty"` + Replicas *ReplicasOpt `json:"replicas,omitempty"` + RetentionDays *int32 `json:"retentionDays,omitempty"` + Storage *StorageUpdate `json:"storage,omitempty"` + Version *InstanceVersionOpt `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() UpdateInstancePartiallyRequestPayloadNetwork { + if o == nil || IsNil(o.Network) { + var ret UpdateInstancePartiallyRequestPayloadNetwork + 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() (*UpdateInstancePartiallyRequestPayloadNetwork, 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 UpdateInstancePartiallyRequestPayloadNetwork and assigns it to the Network field. +func (o *UpdateInstancePartiallyRequestPayload) SetNetwork(v UpdateInstancePartiallyRequestPayloadNetwork) { + 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() InstanceVersionOpt { + if o == nil || IsNil(o.Version) { + var ret InstanceVersionOpt + 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() (*InstanceVersionOpt, 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 InstanceVersionOpt and assigns it to the Version field. +func (o *UpdateInstancePartiallyRequestPayload) SetVersion(v InstanceVersionOpt) { + 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/sqlserverflex/v3alpha1api/model_update_instance_partially_request_payload_network.go b/services/sqlserverflex/v3alpha1api/model_update_instance_partially_request_payload_network.go new file mode 100644 index 000000000..cd4796986 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_update_instance_partially_request_payload_network.go @@ -0,0 +1,126 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 UpdateInstancePartiallyRequestPayloadNetwork type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateInstancePartiallyRequestPayloadNetwork{} + +// UpdateInstancePartiallyRequestPayloadNetwork the network configuration of the instance. +type UpdateInstancePartiallyRequestPayloadNetwork struct { + // List of IPV4 cidr. + Acl []string `json:"acl,omitempty"` +} + +// NewUpdateInstancePartiallyRequestPayloadNetwork instantiates a new UpdateInstancePartiallyRequestPayloadNetwork object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateInstancePartiallyRequestPayloadNetwork() *UpdateInstancePartiallyRequestPayloadNetwork { + this := UpdateInstancePartiallyRequestPayloadNetwork{} + return &this +} + +// NewUpdateInstancePartiallyRequestPayloadNetworkWithDefaults instantiates a new UpdateInstancePartiallyRequestPayloadNetwork object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateInstancePartiallyRequestPayloadNetworkWithDefaults() *UpdateInstancePartiallyRequestPayloadNetwork { + this := UpdateInstancePartiallyRequestPayloadNetwork{} + return &this +} + +// GetAcl returns the Acl field value if set, zero value otherwise. +func (o *UpdateInstancePartiallyRequestPayloadNetwork) 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 *UpdateInstancePartiallyRequestPayloadNetwork) 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 *UpdateInstancePartiallyRequestPayloadNetwork) 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 *UpdateInstancePartiallyRequestPayloadNetwork) SetAcl(v []string) { + o.Acl = v +} + +func (o UpdateInstancePartiallyRequestPayloadNetwork) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateInstancePartiallyRequestPayloadNetwork) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Acl) { + toSerialize["acl"] = o.Acl + } + return toSerialize, nil +} + +type NullableUpdateInstancePartiallyRequestPayloadNetwork struct { + value *UpdateInstancePartiallyRequestPayloadNetwork + isSet bool +} + +func (v NullableUpdateInstancePartiallyRequestPayloadNetwork) Get() *UpdateInstancePartiallyRequestPayloadNetwork { + return v.value +} + +func (v *NullableUpdateInstancePartiallyRequestPayloadNetwork) Set(val *UpdateInstancePartiallyRequestPayloadNetwork) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateInstancePartiallyRequestPayloadNetwork) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateInstancePartiallyRequestPayloadNetwork) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateInstancePartiallyRequestPayloadNetwork(val *UpdateInstancePartiallyRequestPayloadNetwork) *NullableUpdateInstancePartiallyRequestPayloadNetwork { + return &NullableUpdateInstancePartiallyRequestPayloadNetwork{value: val, isSet: true} +} + +func (v NullableUpdateInstancePartiallyRequestPayloadNetwork) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateInstancePartiallyRequestPayloadNetwork) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3alpha1api/model_update_instance_request_payload.go b/services/sqlserverflex/v3alpha1api/model_update_instance_request_payload.go new file mode 100644 index 000000000..36362868b --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_update_instance_request_payload.go @@ -0,0 +1,357 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 on what time and how often the database backup will be created. 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 UpdateInstanceRequestPayloadNetwork `json:"network"` + Replicas Replicas `json:"replicas"` + // The days for how long the backup files should be stored before cleaned up. 30 to 365 + RetentionDays int32 `json:"retentionDays"` + Storage StorageUpdate `json:"storage"` + Version InstanceVersion `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 UpdateInstanceRequestPayloadNetwork, replicas Replicas, retentionDays int32, storage StorageUpdate, version InstanceVersion) *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() UpdateInstanceRequestPayloadNetwork { + if o == nil { + var ret UpdateInstanceRequestPayloadNetwork + 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() (*UpdateInstanceRequestPayloadNetwork, bool) { + if o == nil { + return nil, false + } + return &o.Network, true +} + +// SetNetwork sets field value +func (o *UpdateInstanceRequestPayload) SetNetwork(v UpdateInstanceRequestPayloadNetwork) { + 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() InstanceVersion { + if o == nil { + var ret InstanceVersion + 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() (*InstanceVersion, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *UpdateInstanceRequestPayload) SetVersion(v InstanceVersion) { + 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/sqlserverflex/v3alpha1api/model_update_instance_request_payload_network.go b/services/sqlserverflex/v3alpha1api/model_update_instance_request_payload_network.go new file mode 100644 index 000000000..2062f844c --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_update_instance_request_payload_network.go @@ -0,0 +1,158 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 UpdateInstanceRequestPayloadNetwork type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateInstanceRequestPayloadNetwork{} + +// UpdateInstanceRequestPayloadNetwork the network configuration of the instance. +type UpdateInstanceRequestPayloadNetwork struct { + // List of IPV4 cidr. + Acl []string `json:"acl"` +} + +type _UpdateInstanceRequestPayloadNetwork UpdateInstanceRequestPayloadNetwork + +// NewUpdateInstanceRequestPayloadNetwork instantiates a new UpdateInstanceRequestPayloadNetwork object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateInstanceRequestPayloadNetwork(acl []string) *UpdateInstanceRequestPayloadNetwork { + this := UpdateInstanceRequestPayloadNetwork{} + this.Acl = acl + return &this +} + +// NewUpdateInstanceRequestPayloadNetworkWithDefaults instantiates a new UpdateInstanceRequestPayloadNetwork object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateInstanceRequestPayloadNetworkWithDefaults() *UpdateInstanceRequestPayloadNetwork { + this := UpdateInstanceRequestPayloadNetwork{} + return &this +} + +// GetAcl returns the Acl field value +func (o *UpdateInstanceRequestPayloadNetwork) 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 *UpdateInstanceRequestPayloadNetwork) GetAclOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Acl, true +} + +// SetAcl sets field value +func (o *UpdateInstanceRequestPayloadNetwork) SetAcl(v []string) { + o.Acl = v +} + +func (o UpdateInstanceRequestPayloadNetwork) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateInstanceRequestPayloadNetwork) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["acl"] = o.Acl + return toSerialize, nil +} + +func (o *UpdateInstanceRequestPayloadNetwork) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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) + } + } + + varUpdateInstanceRequestPayloadNetwork := _UpdateInstanceRequestPayloadNetwork{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varUpdateInstanceRequestPayloadNetwork) + + if err != nil { + return err + } + + *o = UpdateInstanceRequestPayloadNetwork(varUpdateInstanceRequestPayloadNetwork) + + return err +} + +type NullableUpdateInstanceRequestPayloadNetwork struct { + value *UpdateInstanceRequestPayloadNetwork + isSet bool +} + +func (v NullableUpdateInstanceRequestPayloadNetwork) Get() *UpdateInstanceRequestPayloadNetwork { + return v.value +} + +func (v *NullableUpdateInstanceRequestPayloadNetwork) Set(val *UpdateInstanceRequestPayloadNetwork) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateInstanceRequestPayloadNetwork) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateInstanceRequestPayloadNetwork) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateInstanceRequestPayloadNetwork(val *UpdateInstanceRequestPayloadNetwork) *NullableUpdateInstanceRequestPayloadNetwork { + return &NullableUpdateInstanceRequestPayloadNetwork{value: val, isSet: true} +} + +func (v NullableUpdateInstanceRequestPayloadNetwork) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateInstanceRequestPayloadNetwork) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3alpha1api/model_user_sort.go b/services/sqlserverflex/v3alpha1api/model_user_sort.go new file mode 100644 index 000000000..d399c8a0e --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_user_sort.go @@ -0,0 +1,123 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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_INDEX_DESC UserSort = "index.desc" + USERSORT_INDEX_ASC UserSort = "index.asc" + 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", + "index.desc", + "index.asc", + "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/sqlserverflex/v3alpha1api/model_validation_error.go b/services/sqlserverflex/v3alpha1api/model_validation_error.go new file mode 100644 index 000000000..0af076ddf --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_validation_error.go @@ -0,0 +1,187 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v3alpha1api/model_validation_error_validation_inner.go b/services/sqlserverflex/v3alpha1api/model_validation_error_validation_inner.go new file mode 100644 index 000000000..009ebf8f2 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_validation_error_validation_inner.go @@ -0,0 +1,185 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v3alpha1api/model_version.go b/services/sqlserverflex/v3alpha1api/model_version.go new file mode 100644 index 000000000..5ebbd72d9 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_version.go @@ -0,0 +1,245 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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 sqlserver 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 sqlserver 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/sqlserverflex/v3alpha1api/response.go b/services/sqlserverflex/v3alpha1api/response.go new file mode 100644 index 000000000..93682b4e8 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/response.go @@ -0,0 +1,48 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v3alpha1api/utils.go b/services/sqlserverflex/v3alpha1api/utils.go new file mode 100644 index 000000000..33b634b65 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/utils.go @@ -0,0 +1,362 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL 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/sqlserverflex/v3beta1api/api_default.go b/services/sqlserverflex/v3beta1api/api_default.go new file mode 100644 index 000000000..088bce83b --- /dev/null +++ b/services/sqlserverflex/v3beta1api/api_default.go @@ -0,0 +1,6083 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v3beta1api + +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 { + + /* + 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, *http.Response, error) + + /* + CreateInstanceRequest Create Instance + + Create a new instance of a sqlserver 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, *http.Response, 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, *http.Response, 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 databaseName The name of the database. + @return ApiDeleteDatabaseRequestRequest + */ + DeleteDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiDeleteDatabaseRequestRequest + + // DeleteDatabaseRequestExecute executes the request + DeleteDatabaseRequestExecute(r ApiDeleteDatabaseRequestRequest) (*http.Response, error) + + /* + DeleteInstanceRequest Delete Instance + + Delete an available sqlserver 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) (*http.Response, 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 int64) ApiDeleteUserRequestRequest + + // DeleteUserRequestExecute executes the request + DeleteUserRequestExecute(r ApiDeleteUserRequestRequest) (*http.Response, 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 int64) ApiGetBackupRequestRequest + + // GetBackupRequestExecute executes the request + // @return GetBackupResponse + GetBackupRequestExecute(r ApiGetBackupRequestRequest) (*GetBackupResponse, *http.Response, error) + + /* + GetCollationsRequest Get database collation list + + Returns a list of 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, *http.Response, error) + + /* + GetDatabaseRequest Get Database + + Get specific available 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. + @param databaseName The name of the database. + @return ApiGetDatabaseRequestRequest + */ + GetDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiGetDatabaseRequestRequest + + // GetDatabaseRequestExecute executes the request + // @return GetDatabaseResponse + GetDatabaseRequestExecute(r ApiGetDatabaseRequestRequest) (*GetDatabaseResponse, *http.Response, 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, *http.Response, 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, *http.Response, error) + + /* + GetStoragesRequest 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 The STACKIT project ID. + @param region The region which should be addressed + @param flavorId The id of an instance flavor. + @return ApiGetStoragesRequestRequest + */ + GetStoragesRequest(ctx context.Context, projectId string, region string, flavorId string) ApiGetStoragesRequestRequest + + // GetStoragesRequestExecute executes the request + // @return GetStoragesResponse + GetStoragesRequestExecute(r ApiGetStoragesRequestRequest) (*GetStoragesResponse, *http.Response, 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 int64) ApiGetUserRequestRequest + + // GetUserRequestExecute executes the request + // @return GetUserResponse + GetUserRequestExecute(r ApiGetUserRequestRequest) (*GetUserResponse, *http.Response, error) + + /* + GetVersionsRequest Get Versions + + Get the sqlserver available 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, *http.Response, 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, *http.Response, error) + + /* + ListCompatibilitiesRequest Get database compatibility list + + Returns a list of compatibility levels for creating a new 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 ApiListCompatibilitiesRequestRequest + */ + ListCompatibilitiesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListCompatibilitiesRequestRequest + + // ListCompatibilitiesRequestExecute executes the request + // @return ListCompatibilityResponse + ListCompatibilitiesRequestExecute(r ApiListCompatibilitiesRequestRequest) (*ListCompatibilityResponse, *http.Response, error) + + /* + ListCurrentRunningRestoreJobs List current running restore jobs + + List all currently running restore jobs 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 ApiListCurrentRunningRestoreJobsRequest + */ + ListCurrentRunningRestoreJobs(ctx context.Context, projectId string, region string, instanceId string) ApiListCurrentRunningRestoreJobsRequest + + // ListCurrentRunningRestoreJobsExecute executes the request + // @return ListCurrentRunningRestoreJobs + ListCurrentRunningRestoreJobsExecute(r ApiListCurrentRunningRestoreJobsRequest) (*ListCurrentRunningRestoreJobs, *http.Response, 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, *http.Response, 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, *http.Response, error) + + /* + ListRolesRequest List Roles + + List available roles for an instance that can be assigned to a user + + @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, *http.Response, 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, *http.Response, 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, *http.Response, 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 int64) ApiResetUserRequestRequest + + // ResetUserRequestExecute executes the request + // @return ResetUserResponse + ResetUserRequestExecute(r ApiResetUserRequestRequest) (*ResetUserResponse, *http.Response, error) + + /* + RestoreDatabaseFromBackup Create a Restore Operation + + Triggers a new restore operation for the specified instance. + The request body defines the source + (e.g., internal backup, external S3) and the target 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 ApiRestoreDatabaseFromBackupRequest + */ + RestoreDatabaseFromBackup(ctx context.Context, projectId string, region string, instanceId string) ApiRestoreDatabaseFromBackupRequest + + // RestoreDatabaseFromBackupExecute executes the request + RestoreDatabaseFromBackupExecute(r ApiRestoreDatabaseFromBackupRequest) (*http.Response, error) + + /* + TriggerBackupRequest Trigger backup for a specific Database + + Trigger backup for a specific 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. + @param databaseName The name of the database. + @return ApiTriggerBackupRequestRequest + */ + TriggerBackupRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiTriggerBackupRequestRequest + + // TriggerBackupRequestExecute executes the request + TriggerBackupRequestExecute(r ApiTriggerBackupRequestRequest) (*http.Response, error) + + /* + TriggerRestoreRequest Trigger restore for a specific Database + + Trigger restore for a specific 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. + @param databaseName The name of the database. + @return ApiTriggerRestoreRequestRequest + */ + TriggerRestoreRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiTriggerRestoreRequestRequest + + // TriggerRestoreRequestExecute executes the request + TriggerRestoreRequestExecute(r ApiTriggerRestoreRequestRequest) (*http.Response, error) + + /* + UpdateInstancePartiallyRequest Update Instance Partially + + Update an available instance of a mssql database. No fields are required. + + **Please note that any changes applied via PUT or PATCH requests will initiate a reboot of the SQL Server Flex 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 ApiUpdateInstancePartiallyRequestRequest + */ + UpdateInstancePartiallyRequest(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstancePartiallyRequestRequest + + // UpdateInstancePartiallyRequestExecute executes the request + UpdateInstancePartiallyRequestExecute(r ApiUpdateInstancePartiallyRequestRequest) (*http.Response, error) + + /* + UpdateInstanceRequest Update Instance + + Updates an available instance of a sqlserver database + + **Please note that any changes applied via PUT or PATCH requests will initiate a reboot of the SQL Server Flex 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 ApiUpdateInstanceRequestRequest + */ + UpdateInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceRequestRequest + + // UpdateInstanceRequestExecute executes the request + UpdateInstanceRequestExecute(r ApiUpdateInstanceRequestRequest) (*http.Response, error) +} + +// DefaultAPIService DefaultAPI service +type DefaultAPIService service + +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, *http.Response, 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, *http.Response, 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, nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3beta1/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, nil, 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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, 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, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, 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, *http.Response, error) { + return r.ApiService.CreateInstanceRequestExecute(r) +} + +/* +CreateInstanceRequest Create Instance + +Create a new instance of a sqlserver 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, *http.Response, 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, nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3beta1/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, nil, 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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, 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, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, 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, *http.Response, 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, *http.Response, 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, nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3beta1/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, nil, 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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, 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, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, 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, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeleteDatabaseRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + databaseName string +} + +func (r ApiDeleteDatabaseRequestRequest) Execute() (*http.Response, 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 databaseName The name of the database. + @return ApiDeleteDatabaseRequestRequest +*/ +func (a *DefaultAPIService) DeleteDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiDeleteDatabaseRequestRequest { + return ApiDeleteDatabaseRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + databaseName: databaseName, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteDatabaseRequestExecute(r ApiDeleteDatabaseRequestRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteDatabaseRequest") + if err != nil { + return nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3beta1/projects/{projectId}/regions/{region}/instances/{instanceId}/databases/{databaseName}" + 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, "{"+"databaseName"+"}", url.PathEscape(parameterValueToString(r.databaseName, "databaseName")), -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 nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDeleteInstanceRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string +} + +func (r ApiDeleteInstanceRequestRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteInstanceRequestExecute(r) +} + +/* +DeleteInstanceRequest Delete Instance + +Delete an available sqlserver 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) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteInstanceRequest") + if err != nil { + return nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3beta1/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 nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDeleteUserRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + userId int64 +} + +func (r ApiDeleteUserRequestRequest) Execute() (*http.Response, 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 int64) 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) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteUserRequest") + if err != nil { + return nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3beta1/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 nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiGetBackupRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + backupId int64 +} + +func (r ApiGetBackupRequestRequest) Execute() (*GetBackupResponse, *http.Response, 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 int64) 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, *http.Response, 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, nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3beta1/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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, 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, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetCollationsRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string +} + +func (r ApiGetCollationsRequestRequest) Execute() (*GetCollationsResponse, *http.Response, error) { + return r.ApiService.GetCollationsRequestExecute(r) +} + +/* +GetCollationsRequest Get database collation list + +Returns a list of 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, *http.Response, 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, nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3beta1/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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, 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, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetDatabaseRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + databaseName string +} + +func (r ApiGetDatabaseRequestRequest) Execute() (*GetDatabaseResponse, *http.Response, error) { + return r.ApiService.GetDatabaseRequestExecute(r) +} + +/* +GetDatabaseRequest Get Database + +Get specific available 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. + @param databaseName The name of the database. + @return ApiGetDatabaseRequestRequest +*/ +func (a *DefaultAPIService) GetDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiGetDatabaseRequestRequest { + return ApiGetDatabaseRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + databaseName: databaseName, + } +} + +// Execute executes the request +// +// @return GetDatabaseResponse +func (a *DefaultAPIService) GetDatabaseRequestExecute(r ApiGetDatabaseRequestRequest) (*GetDatabaseResponse, *http.Response, 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, nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3beta1/projects/{projectId}/regions/{region}/instances/{instanceId}/databases/{databaseName}" + 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, "{"+"databaseName"+"}", url.PathEscape(parameterValueToString(r.databaseName, "databaseName")), -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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, 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, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetFlavorsRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + page *int64 + size *int64 + sort *FlavorSort +} + +// Number of the page of items list to be returned. +func (r ApiGetFlavorsRequestRequest) Page(page int64) ApiGetFlavorsRequestRequest { + r.page = &page + return r +} + +// Number of items to be returned on each page. +func (r ApiGetFlavorsRequestRequest) Size(size int64) 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, *http.Response, 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, *http.Response, 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, nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3beta1/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 int64 = 1 + parameterAddToHeaderOrQuery(localVarQueryParams, "page", defaultValue, "form", "") + r.page = &defaultValue + } + if r.size != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "form", "") + } else { + var defaultValue int64 = 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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, 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, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetInstanceRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string +} + +func (r ApiGetInstanceRequestRequest) Execute() (*GetInstanceResponse, *http.Response, 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, *http.Response, 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, nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3beta1/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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetStoragesRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + flavorId string +} + +func (r ApiGetStoragesRequestRequest) Execute() (*GetStoragesResponse, *http.Response, error) { + return r.ApiService.GetStoragesRequestExecute(r) +} + +/* +GetStoragesRequest 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 The STACKIT project ID. + @param region The region which should be addressed + @param flavorId The id of an instance flavor. + @return ApiGetStoragesRequestRequest +*/ +func (a *DefaultAPIService) GetStoragesRequest(ctx context.Context, projectId string, region string, flavorId string) ApiGetStoragesRequestRequest { + return ApiGetStoragesRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + flavorId: flavorId, + } +} + +// Execute executes the request +// +// @return GetStoragesResponse +func (a *DefaultAPIService) GetStoragesRequestExecute(r ApiGetStoragesRequestRequest) (*GetStoragesResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetStoragesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetStoragesRequest") + if err != nil { + return localVarReturnValue, nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3beta1/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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetUserRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + userId int64 +} + +func (r ApiGetUserRequestRequest) Execute() (*GetUserResponse, *http.Response, 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 int64) 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, *http.Response, 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, nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3beta1/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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetVersionsRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string +} + +func (r ApiGetVersionsRequestRequest) Execute() (*GetVersionsResponse, *http.Response, error) { + return r.ApiService.GetVersionsRequestExecute(r) +} + +/* +GetVersionsRequest Get Versions + +Get the sqlserver available 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, *http.Response, 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, nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3beta1/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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, 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, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListBackupsRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + page *int64 + size *int64 + sort *BackupSort +} + +// Number of the page of items list to be returned. +func (r ApiListBackupsRequestRequest) Page(page int64) ApiListBackupsRequestRequest { + r.page = &page + return r +} + +// Number of items to be returned on each page. +func (r ApiListBackupsRequestRequest) Size(size int64) 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, *http.Response, 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, *http.Response, 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, nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3beta1/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 int64 = 1 + parameterAddToHeaderOrQuery(localVarQueryParams, "page", defaultValue, "form", "") + r.page = &defaultValue + } + if r.size != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "form", "") + } else { + var defaultValue int64 = 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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, 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, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListCompatibilitiesRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string +} + +func (r ApiListCompatibilitiesRequestRequest) Execute() (*ListCompatibilityResponse, *http.Response, error) { + return r.ApiService.ListCompatibilitiesRequestExecute(r) +} + +/* +ListCompatibilitiesRequest Get database compatibility list + +Returns a list of compatibility levels for creating a new 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 ApiListCompatibilitiesRequestRequest +*/ +func (a *DefaultAPIService) ListCompatibilitiesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListCompatibilitiesRequestRequest { + return ApiListCompatibilitiesRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListCompatibilityResponse +func (a *DefaultAPIService) ListCompatibilitiesRequestExecute(r ApiListCompatibilitiesRequestRequest) (*ListCompatibilityResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListCompatibilityResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListCompatibilitiesRequest") + if err != nil { + return localVarReturnValue, nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3beta1/projects/{projectId}/regions/{region}/instances/{instanceId}/compatibility" + 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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, 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, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListCurrentRunningRestoreJobsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string +} + +func (r ApiListCurrentRunningRestoreJobsRequest) Execute() (*ListCurrentRunningRestoreJobs, *http.Response, error) { + return r.ApiService.ListCurrentRunningRestoreJobsExecute(r) +} + +/* +ListCurrentRunningRestoreJobs List current running restore jobs + +List all currently running restore jobs 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 ApiListCurrentRunningRestoreJobsRequest +*/ +func (a *DefaultAPIService) ListCurrentRunningRestoreJobs(ctx context.Context, projectId string, region string, instanceId string) ApiListCurrentRunningRestoreJobsRequest { + return ApiListCurrentRunningRestoreJobsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListCurrentRunningRestoreJobs +func (a *DefaultAPIService) ListCurrentRunningRestoreJobsExecute(r ApiListCurrentRunningRestoreJobsRequest) (*ListCurrentRunningRestoreJobs, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListCurrentRunningRestoreJobs + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListCurrentRunningRestoreJobs") + if err != nil { + return localVarReturnValue, nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3beta1/projects/{projectId}/regions/{region}/instances/{instanceId}/restore-jobs" + 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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, 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, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListDatabasesRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + page *int64 + size *int64 + sort *DatabaseSort +} + +// Number of the page of items list to be returned. +func (r ApiListDatabasesRequestRequest) Page(page int64) ApiListDatabasesRequestRequest { + r.page = &page + return r +} + +// Number of items to be returned on each page. +func (r ApiListDatabasesRequestRequest) Size(size int64) 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, *http.Response, 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, *http.Response, 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, nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3beta1/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 int64 = 1 + parameterAddToHeaderOrQuery(localVarQueryParams, "page", defaultValue, "form", "") + r.page = &defaultValue + } + if r.size != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "form", "") + } else { + var defaultValue int64 = 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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListInstancesRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + page *int64 + size *int64 + sort *InstanceSort +} + +// Number of the page of items list to be returned. +func (r ApiListInstancesRequestRequest) Page(page int64) ApiListInstancesRequestRequest { + r.page = &page + return r +} + +// Number of items to be returned on each page. +func (r ApiListInstancesRequestRequest) Size(size int64) 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, *http.Response, 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, *http.Response, 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, nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3beta1/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 int64 = 1 + parameterAddToHeaderOrQuery(localVarQueryParams, "page", defaultValue, "form", "") + r.page = &defaultValue + } + if r.size != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "form", "") + } else { + var defaultValue int64 = 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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListRolesRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string +} + +func (r ApiListRolesRequestRequest) Execute() (*ListRolesResponse, *http.Response, error) { + return r.ApiService.ListRolesRequestExecute(r) +} + +/* +ListRolesRequest List Roles + +List available roles for an instance that can be assigned to a user + + @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, *http.Response, 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, nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3beta1/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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, 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, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListUsersRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + page *int64 + size *int64 + sort *UserSort +} + +// Number of the page of items list to be returned. +func (r ApiListUsersRequestRequest) Page(page int64) ApiListUsersRequestRequest { + r.page = &page + return r +} + +// Number of items to be returned on each page. +func (r ApiListUsersRequestRequest) Size(size int64) 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, *http.Response, 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, *http.Response, 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, nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3beta1/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 int64 = 1 + parameterAddToHeaderOrQuery(localVarQueryParams, "page", defaultValue, "form", "") + r.page = &defaultValue + } + if r.size != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "form", "") + } else { + var defaultValue int64 = 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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, 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, *http.Response, 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, *http.Response, 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, nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3beta1/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, nil, 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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, 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, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, 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, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiResetUserRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + userId int64 +} + +func (r ApiResetUserRequestRequest) Execute() (*ResetUserResponse, *http.Response, 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 int64) 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, *http.Response, 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, nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3beta1/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, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, 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, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRestoreDatabaseFromBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + restoreDatabaseFromBackupPayload *RestoreDatabaseFromBackupPayload +} + +// The restore operation payload. +func (r ApiRestoreDatabaseFromBackupRequest) RestoreDatabaseFromBackupPayload(restoreDatabaseFromBackupPayload RestoreDatabaseFromBackupPayload) ApiRestoreDatabaseFromBackupRequest { + r.restoreDatabaseFromBackupPayload = &restoreDatabaseFromBackupPayload + return r +} + +func (r ApiRestoreDatabaseFromBackupRequest) Execute() (*http.Response, error) { + return r.ApiService.RestoreDatabaseFromBackupExecute(r) +} + +/* +RestoreDatabaseFromBackup Create a Restore Operation + +Triggers a new restore operation for the specified instance. +The request body defines the source +(e.g., internal backup, external S3) and the target 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 ApiRestoreDatabaseFromBackupRequest +*/ +func (a *DefaultAPIService) RestoreDatabaseFromBackup(ctx context.Context, projectId string, region string, instanceId string) ApiRestoreDatabaseFromBackupRequest { + return ApiRestoreDatabaseFromBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) RestoreDatabaseFromBackupExecute(r ApiRestoreDatabaseFromBackupRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.RestoreDatabaseFromBackup") + if err != nil { + return nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3beta1/projects/{projectId}/regions/{region}/instances/{instanceId}/restores" + 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.restoreDatabaseFromBackupPayload == nil { + return nil, reportError("restoreDatabaseFromBackupPayload 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.restoreDatabaseFromBackupPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, 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 localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiTriggerBackupRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + databaseName string +} + +func (r ApiTriggerBackupRequestRequest) Execute() (*http.Response, error) { + return r.ApiService.TriggerBackupRequestExecute(r) +} + +/* +TriggerBackupRequest Trigger backup for a specific Database + +Trigger backup for a specific 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. + @param databaseName The name of the database. + @return ApiTriggerBackupRequestRequest +*/ +func (a *DefaultAPIService) TriggerBackupRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiTriggerBackupRequestRequest { + return ApiTriggerBackupRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + databaseName: databaseName, + } +} + +// Execute executes the request +func (a *DefaultAPIService) TriggerBackupRequestExecute(r ApiTriggerBackupRequestRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.TriggerBackupRequest") + if err != nil { + return nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3beta1/projects/{projectId}/regions/{region}/instances/{instanceId}/backups/databases/{databaseName}" + 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, "{"+"databaseName"+"}", url.PathEscape(parameterValueToString(r.databaseName, "databaseName")), -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 nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, 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 localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, 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 localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiTriggerRestoreRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + databaseName string + triggerRestoreRequestPayload *TriggerRestoreRequestPayload +} + +// The request body with the parameters for the database restore. +func (r ApiTriggerRestoreRequestRequest) TriggerRestoreRequestPayload(triggerRestoreRequestPayload TriggerRestoreRequestPayload) ApiTriggerRestoreRequestRequest { + r.triggerRestoreRequestPayload = &triggerRestoreRequestPayload + return r +} + +func (r ApiTriggerRestoreRequestRequest) Execute() (*http.Response, error) { + return r.ApiService.TriggerRestoreRequestExecute(r) +} + +/* +TriggerRestoreRequest Trigger restore for a specific Database + +Trigger restore for a specific 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. + @param databaseName The name of the database. + @return ApiTriggerRestoreRequestRequest +*/ +func (a *DefaultAPIService) TriggerRestoreRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiTriggerRestoreRequestRequest { + return ApiTriggerRestoreRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + databaseName: databaseName, + } +} + +// Execute executes the request +func (a *DefaultAPIService) TriggerRestoreRequestExecute(r ApiTriggerRestoreRequestRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.TriggerRestoreRequest") + if err != nil { + return nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3beta1/projects/{projectId}/regions/{region}/instances/{instanceId}/backups/databases/{databaseName}/restores" + 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, "{"+"databaseName"+"}", url.PathEscape(parameterValueToString(r.databaseName, "databaseName")), -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.triggerRestoreRequestPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, 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 localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, 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 localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, 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() (*http.Response, error) { + return r.ApiService.UpdateInstancePartiallyRequestExecute(r) +} + +/* +UpdateInstancePartiallyRequest Update Instance Partially + +Update an available instance of a mssql database. No fields are required. + +**Please note that any changes applied via PUT or PATCH requests will initiate a reboot of the SQL Server Flex 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 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) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateInstancePartiallyRequest") + if err != nil { + return nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3beta1/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 nil, 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 nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, 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 localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, 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() (*http.Response, error) { + return r.ApiService.UpdateInstanceRequestExecute(r) +} + +/* +UpdateInstanceRequest Update Instance + +# Updates an available instance of a sqlserver database + +**Please note that any changes applied via PUT or PATCH requests will initiate a reboot of the SQL Server Flex 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 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) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateInstanceRequest") + if err != nil { + return nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3beta1/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 nil, 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 nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, 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 localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} diff --git a/services/sqlserverflex/v3beta1api/api_default_mock.go b/services/sqlserverflex/v3beta1api/api_default_mock.go new file mode 100644 index 000000000..e07a2057f --- /dev/null +++ b/services/sqlserverflex/v3beta1api/api_default_mock.go @@ -0,0 +1,637 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +import ( + "context" + "net/http" +) + +// 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 { + // CreateDatabaseRequestExecuteMock can be populated to implement the behavior of the CreateDatabaseRequestExecute function of this mock + CreateDatabaseRequestExecuteMock *func(r ApiCreateDatabaseRequestRequest) (*CreateDatabaseResponse, *http.Response, error) + // CreateInstanceRequestExecuteMock can be populated to implement the behavior of the CreateInstanceRequestExecute function of this mock + CreateInstanceRequestExecuteMock *func(r ApiCreateInstanceRequestRequest) (*CreateInstanceResponse, *http.Response, error) + // CreateUserRequestExecuteMock can be populated to implement the behavior of the CreateUserRequestExecute function of this mock + CreateUserRequestExecuteMock *func(r ApiCreateUserRequestRequest) (*CreateUserResponse, *http.Response, error) + // DeleteDatabaseRequestExecuteMock can be populated to implement the behavior of the DeleteDatabaseRequestExecute function of this mock + DeleteDatabaseRequestExecuteMock *func(r ApiDeleteDatabaseRequestRequest) (*http.Response, error) + // DeleteInstanceRequestExecuteMock can be populated to implement the behavior of the DeleteInstanceRequestExecute function of this mock + DeleteInstanceRequestExecuteMock *func(r ApiDeleteInstanceRequestRequest) (*http.Response, error) + // DeleteUserRequestExecuteMock can be populated to implement the behavior of the DeleteUserRequestExecute function of this mock + DeleteUserRequestExecuteMock *func(r ApiDeleteUserRequestRequest) (*http.Response, error) + // GetBackupRequestExecuteMock can be populated to implement the behavior of the GetBackupRequestExecute function of this mock + GetBackupRequestExecuteMock *func(r ApiGetBackupRequestRequest) (*GetBackupResponse, *http.Response, error) + // GetCollationsRequestExecuteMock can be populated to implement the behavior of the GetCollationsRequestExecute function of this mock + GetCollationsRequestExecuteMock *func(r ApiGetCollationsRequestRequest) (*GetCollationsResponse, *http.Response, error) + // GetDatabaseRequestExecuteMock can be populated to implement the behavior of the GetDatabaseRequestExecute function of this mock + GetDatabaseRequestExecuteMock *func(r ApiGetDatabaseRequestRequest) (*GetDatabaseResponse, *http.Response, error) + // GetFlavorsRequestExecuteMock can be populated to implement the behavior of the GetFlavorsRequestExecute function of this mock + GetFlavorsRequestExecuteMock *func(r ApiGetFlavorsRequestRequest) (*GetFlavorsResponse, *http.Response, error) + // GetInstanceRequestExecuteMock can be populated to implement the behavior of the GetInstanceRequestExecute function of this mock + GetInstanceRequestExecuteMock *func(r ApiGetInstanceRequestRequest) (*GetInstanceResponse, *http.Response, error) + // GetStoragesRequestExecuteMock can be populated to implement the behavior of the GetStoragesRequestExecute function of this mock + GetStoragesRequestExecuteMock *func(r ApiGetStoragesRequestRequest) (*GetStoragesResponse, *http.Response, error) + // GetUserRequestExecuteMock can be populated to implement the behavior of the GetUserRequestExecute function of this mock + GetUserRequestExecuteMock *func(r ApiGetUserRequestRequest) (*GetUserResponse, *http.Response, error) + // GetVersionsRequestExecuteMock can be populated to implement the behavior of the GetVersionsRequestExecute function of this mock + GetVersionsRequestExecuteMock *func(r ApiGetVersionsRequestRequest) (*GetVersionsResponse, *http.Response, error) + // ListBackupsRequestExecuteMock can be populated to implement the behavior of the ListBackupsRequestExecute function of this mock + ListBackupsRequestExecuteMock *func(r ApiListBackupsRequestRequest) (*ListBackupResponse, *http.Response, error) + // ListCompatibilitiesRequestExecuteMock can be populated to implement the behavior of the ListCompatibilitiesRequestExecute function of this mock + ListCompatibilitiesRequestExecuteMock *func(r ApiListCompatibilitiesRequestRequest) (*ListCompatibilityResponse, *http.Response, error) + // ListCurrentRunningRestoreJobsExecuteMock can be populated to implement the behavior of the ListCurrentRunningRestoreJobsExecute function of this mock + ListCurrentRunningRestoreJobsExecuteMock *func(r ApiListCurrentRunningRestoreJobsRequest) (*ListCurrentRunningRestoreJobs, *http.Response, error) + // ListDatabasesRequestExecuteMock can be populated to implement the behavior of the ListDatabasesRequestExecute function of this mock + ListDatabasesRequestExecuteMock *func(r ApiListDatabasesRequestRequest) (*ListDatabasesResponse, *http.Response, error) + // ListInstancesRequestExecuteMock can be populated to implement the behavior of the ListInstancesRequestExecute function of this mock + ListInstancesRequestExecuteMock *func(r ApiListInstancesRequestRequest) (*ListInstancesResponse, *http.Response, error) + // ListRolesRequestExecuteMock can be populated to implement the behavior of the ListRolesRequestExecute function of this mock + ListRolesRequestExecuteMock *func(r ApiListRolesRequestRequest) (*ListRolesResponse, *http.Response, error) + // ListUsersRequestExecuteMock can be populated to implement the behavior of the ListUsersRequestExecute function of this mock + ListUsersRequestExecuteMock *func(r ApiListUsersRequestRequest) (*ListUserResponse, *http.Response, error) + // ProtectInstanceRequestExecuteMock can be populated to implement the behavior of the ProtectInstanceRequestExecute function of this mock + ProtectInstanceRequestExecuteMock *func(r ApiProtectInstanceRequestRequest) (*ProtectInstanceResponse, *http.Response, error) + // ResetUserRequestExecuteMock can be populated to implement the behavior of the ResetUserRequestExecute function of this mock + ResetUserRequestExecuteMock *func(r ApiResetUserRequestRequest) (*ResetUserResponse, *http.Response, error) + // RestoreDatabaseFromBackupExecuteMock can be populated to implement the behavior of the RestoreDatabaseFromBackupExecute function of this mock + RestoreDatabaseFromBackupExecuteMock *func(r ApiRestoreDatabaseFromBackupRequest) (*http.Response, error) + // TriggerBackupRequestExecuteMock can be populated to implement the behavior of the TriggerBackupRequestExecute function of this mock + TriggerBackupRequestExecuteMock *func(r ApiTriggerBackupRequestRequest) (*http.Response, error) + // TriggerRestoreRequestExecuteMock can be populated to implement the behavior of the TriggerRestoreRequestExecute function of this mock + TriggerRestoreRequestExecuteMock *func(r ApiTriggerRestoreRequestRequest) (*http.Response, error) + // UpdateInstancePartiallyRequestExecuteMock can be populated to implement the behavior of the UpdateInstancePartiallyRequestExecute function of this mock + UpdateInstancePartiallyRequestExecuteMock *func(r ApiUpdateInstancePartiallyRequestRequest) (*http.Response, error) + // UpdateInstanceRequestExecuteMock can be populated to implement the behavior of the UpdateInstanceRequestExecute function of this mock + UpdateInstanceRequestExecuteMock *func(r ApiUpdateInstanceRequestRequest) (*http.Response, error) +} + +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, *http.Response, error) { + if a.CreateDatabaseRequestExecuteMock == nil { + var localVarReturnValue *CreateDatabaseResponse + return localVarReturnValue, &http.Response{}, 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, *http.Response, error) { + if a.CreateInstanceRequestExecuteMock == nil { + var localVarReturnValue *CreateInstanceResponse + return localVarReturnValue, &http.Response{}, 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, *http.Response, error) { + if a.CreateUserRequestExecuteMock == nil { + var localVarReturnValue *CreateUserResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.CreateUserRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiDeleteDatabaseRequestRequest { + return ApiDeleteDatabaseRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + databaseName: databaseName, + } +} + +// 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) (*http.Response, error) { + if a.DeleteDatabaseRequestExecuteMock == nil { + return &http.Response{}, 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) (*http.Response, error) { + if a.DeleteInstanceRequestExecuteMock == nil { + return &http.Response{}, nil + } + + return (*a.DeleteInstanceRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int64) 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) (*http.Response, error) { + if a.DeleteUserRequestExecuteMock == nil { + return &http.Response{}, nil + } + + return (*a.DeleteUserRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetBackupRequest(ctx context.Context, projectId string, region string, instanceId string, backupId int64) 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, *http.Response, error) { + if a.GetBackupRequestExecuteMock == nil { + var localVarReturnValue *GetBackupResponse + return localVarReturnValue, &http.Response{}, 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, *http.Response, error) { + if a.GetCollationsRequestExecuteMock == nil { + var localVarReturnValue *GetCollationsResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.GetCollationsRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiGetDatabaseRequestRequest { + return ApiGetDatabaseRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + databaseName: databaseName, + } +} + +// 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, *http.Response, error) { + if a.GetDatabaseRequestExecuteMock == nil { + var localVarReturnValue *GetDatabaseResponse + return localVarReturnValue, &http.Response{}, 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, *http.Response, error) { + if a.GetFlavorsRequestExecuteMock == nil { + var localVarReturnValue *GetFlavorsResponse + return localVarReturnValue, &http.Response{}, 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, *http.Response, error) { + if a.GetInstanceRequestExecuteMock == nil { + var localVarReturnValue *GetInstanceResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.GetInstanceRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetStoragesRequest(ctx context.Context, projectId string, region string, flavorId string) ApiGetStoragesRequestRequest { + return ApiGetStoragesRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + flavorId: flavorId, + } +} + +// GetStoragesRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetStoragesRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetStoragesRequestExecute(r ApiGetStoragesRequestRequest) (*GetStoragesResponse, *http.Response, error) { + if a.GetStoragesRequestExecuteMock == nil { + var localVarReturnValue *GetStoragesResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.GetStoragesRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int64) 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, *http.Response, error) { + if a.GetUserRequestExecuteMock == nil { + var localVarReturnValue *GetUserResponse + return localVarReturnValue, &http.Response{}, 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, *http.Response, error) { + if a.GetVersionsRequestExecuteMock == nil { + var localVarReturnValue *GetVersionsResponse + return localVarReturnValue, &http.Response{}, 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, *http.Response, error) { + if a.ListBackupsRequestExecuteMock == nil { + var localVarReturnValue *ListBackupResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.ListBackupsRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListCompatibilitiesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListCompatibilitiesRequestRequest { + return ApiListCompatibilitiesRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// ListCompatibilitiesRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListCompatibilitiesRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListCompatibilitiesRequestExecute(r ApiListCompatibilitiesRequestRequest) (*ListCompatibilityResponse, *http.Response, error) { + if a.ListCompatibilitiesRequestExecuteMock == nil { + var localVarReturnValue *ListCompatibilityResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.ListCompatibilitiesRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListCurrentRunningRestoreJobs(ctx context.Context, projectId string, region string, instanceId string) ApiListCurrentRunningRestoreJobsRequest { + return ApiListCurrentRunningRestoreJobsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// ListCurrentRunningRestoreJobsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListCurrentRunningRestoreJobsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListCurrentRunningRestoreJobsExecute(r ApiListCurrentRunningRestoreJobsRequest) (*ListCurrentRunningRestoreJobs, *http.Response, error) { + if a.ListCurrentRunningRestoreJobsExecuteMock == nil { + var localVarReturnValue *ListCurrentRunningRestoreJobs + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.ListCurrentRunningRestoreJobsExecuteMock)(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, *http.Response, error) { + if a.ListDatabasesRequestExecuteMock == nil { + var localVarReturnValue *ListDatabasesResponse + return localVarReturnValue, &http.Response{}, 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, *http.Response, error) { + if a.ListInstancesRequestExecuteMock == nil { + var localVarReturnValue *ListInstancesResponse + return localVarReturnValue, &http.Response{}, 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, *http.Response, error) { + if a.ListRolesRequestExecuteMock == nil { + var localVarReturnValue *ListRolesResponse + return localVarReturnValue, &http.Response{}, 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, *http.Response, error) { + if a.ListUsersRequestExecuteMock == nil { + var localVarReturnValue *ListUserResponse + return localVarReturnValue, &http.Response{}, 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, *http.Response, error) { + if a.ProtectInstanceRequestExecuteMock == nil { + var localVarReturnValue *ProtectInstanceResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.ProtectInstanceRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ResetUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int64) 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, *http.Response, error) { + if a.ResetUserRequestExecuteMock == nil { + var localVarReturnValue *ResetUserResponse + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.ResetUserRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) RestoreDatabaseFromBackup(ctx context.Context, projectId string, region string, instanceId string) ApiRestoreDatabaseFromBackupRequest { + return ApiRestoreDatabaseFromBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// RestoreDatabaseFromBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the RestoreDatabaseFromBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) RestoreDatabaseFromBackupExecute(r ApiRestoreDatabaseFromBackupRequest) (*http.Response, error) { + if a.RestoreDatabaseFromBackupExecuteMock == nil { + return &http.Response{}, nil + } + + return (*a.RestoreDatabaseFromBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) TriggerBackupRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiTriggerBackupRequestRequest { + return ApiTriggerBackupRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + databaseName: databaseName, + } +} + +// TriggerBackupRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the TriggerBackupRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) TriggerBackupRequestExecute(r ApiTriggerBackupRequestRequest) (*http.Response, error) { + if a.TriggerBackupRequestExecuteMock == nil { + return &http.Response{}, nil + } + + return (*a.TriggerBackupRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) TriggerRestoreRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiTriggerRestoreRequestRequest { + return ApiTriggerRestoreRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + databaseName: databaseName, + } +} + +// TriggerRestoreRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the TriggerRestoreRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) TriggerRestoreRequestExecute(r ApiTriggerRestoreRequestRequest) (*http.Response, error) { + if a.TriggerRestoreRequestExecuteMock == nil { + return &http.Response{}, nil + } + + return (*a.TriggerRestoreRequestExecuteMock)(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) (*http.Response, error) { + if a.UpdateInstancePartiallyRequestExecuteMock == nil { + return &http.Response{}, 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) (*http.Response, error) { + if a.UpdateInstanceRequestExecuteMock == nil { + return &http.Response{}, nil + } + + return (*a.UpdateInstanceRequestExecuteMock)(r) +} diff --git a/services/sqlserverflex/v3beta1api/client.go b/services/sqlserverflex/v3beta1api/client.go new file mode 100644 index 000000000..24b161ab7 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/client.go @@ -0,0 +1,659 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v3beta1api + +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 MSSQL Service API API v3beta1 +// 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/sqlserverflex/v3beta1api/configuration.go b/services/sqlserverflex/v3beta1api/configuration.go new file mode 100644 index 000000000..8a4ed17c8 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/configuration.go @@ -0,0 +1,41 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v3beta1api + +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/sqlserverflex", + Debug: false, + Servers: config.ServerConfigurations{ + { + URL: "https://mssql-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/sqlserverflex/v3beta1api/model_backup_running_restore.go b/services/sqlserverflex/v3beta1api/model_backup_running_restore.go new file mode 100644 index 000000000..88d519138 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_backup_running_restore.go @@ -0,0 +1,274 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the BackupRunningRestore type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BackupRunningRestore{} + +// BackupRunningRestore struct for BackupRunningRestore +type BackupRunningRestore struct { + // the command that was executed + Command string `json:"command" validate:"required,restoreCommand"` + // the name of the database that is being restored + DatabaseName string `json:"database_name" validate:"required,databaseName"` + // the projected time when the restore should be completed + EstimatedCompletionTime string `json:"estimated_completion_time" validate:"required,time"` + // the percentage of the current running restore job + PercentComplete int32 `json:"percent_complete" validate:"required,min=0,max=100"` + // the start time of the current running restore job + StartTime string `json:"start_time" validate:"required,time"` +} + +type _BackupRunningRestore BackupRunningRestore + +// NewBackupRunningRestore instantiates a new BackupRunningRestore object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBackupRunningRestore(command string, databaseName string, estimatedCompletionTime string, percentComplete int32, startTime string) *BackupRunningRestore { + this := BackupRunningRestore{} + this.Command = command + this.DatabaseName = databaseName + this.EstimatedCompletionTime = estimatedCompletionTime + this.PercentComplete = percentComplete + this.StartTime = startTime + return &this +} + +// NewBackupRunningRestoreWithDefaults instantiates a new BackupRunningRestore object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBackupRunningRestoreWithDefaults() *BackupRunningRestore { + this := BackupRunningRestore{} + return &this +} + +// GetCommand returns the Command field value +func (o *BackupRunningRestore) GetCommand() string { + if o == nil { + var ret string + return ret + } + + return o.Command +} + +// GetCommandOk returns a tuple with the Command field value +// and a boolean to check if the value has been set. +func (o *BackupRunningRestore) GetCommandOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Command, true +} + +// SetCommand sets field value +func (o *BackupRunningRestore) SetCommand(v string) { + o.Command = v +} + +// GetDatabaseName returns the DatabaseName field value +func (o *BackupRunningRestore) GetDatabaseName() string { + if o == nil { + var ret string + return ret + } + + return o.DatabaseName +} + +// GetDatabaseNameOk returns a tuple with the DatabaseName field value +// and a boolean to check if the value has been set. +func (o *BackupRunningRestore) GetDatabaseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DatabaseName, true +} + +// SetDatabaseName sets field value +func (o *BackupRunningRestore) SetDatabaseName(v string) { + o.DatabaseName = v +} + +// GetEstimatedCompletionTime returns the EstimatedCompletionTime field value +func (o *BackupRunningRestore) GetEstimatedCompletionTime() string { + if o == nil { + var ret string + return ret + } + + return o.EstimatedCompletionTime +} + +// GetEstimatedCompletionTimeOk returns a tuple with the EstimatedCompletionTime field value +// and a boolean to check if the value has been set. +func (o *BackupRunningRestore) GetEstimatedCompletionTimeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EstimatedCompletionTime, true +} + +// SetEstimatedCompletionTime sets field value +func (o *BackupRunningRestore) SetEstimatedCompletionTime(v string) { + o.EstimatedCompletionTime = v +} + +// GetPercentComplete returns the PercentComplete field value +func (o *BackupRunningRestore) GetPercentComplete() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.PercentComplete +} + +// GetPercentCompleteOk returns a tuple with the PercentComplete field value +// and a boolean to check if the value has been set. +func (o *BackupRunningRestore) GetPercentCompleteOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.PercentComplete, true +} + +// SetPercentComplete sets field value +func (o *BackupRunningRestore) SetPercentComplete(v int32) { + o.PercentComplete = v +} + +// GetStartTime returns the StartTime field value +func (o *BackupRunningRestore) GetStartTime() string { + if o == nil { + var ret string + return ret + } + + return o.StartTime +} + +// GetStartTimeOk returns a tuple with the StartTime field value +// and a boolean to check if the value has been set. +func (o *BackupRunningRestore) GetStartTimeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.StartTime, true +} + +// SetStartTime sets field value +func (o *BackupRunningRestore) SetStartTime(v string) { + o.StartTime = v +} + +func (o BackupRunningRestore) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BackupRunningRestore) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["command"] = o.Command + toSerialize["database_name"] = o.DatabaseName + toSerialize["estimated_completion_time"] = o.EstimatedCompletionTime + toSerialize["percent_complete"] = o.PercentComplete + toSerialize["start_time"] = o.StartTime + return toSerialize, nil +} + +func (o *BackupRunningRestore) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "command", + "database_name", + "estimated_completion_time", + "percent_complete", + "start_time", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBackupRunningRestore := _BackupRunningRestore{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBackupRunningRestore) + + if err != nil { + return err + } + + *o = BackupRunningRestore(varBackupRunningRestore) + + return err +} + +type NullableBackupRunningRestore struct { + value *BackupRunningRestore + isSet bool +} + +func (v NullableBackupRunningRestore) Get() *BackupRunningRestore { + return v.value +} + +func (v *NullableBackupRunningRestore) Set(val *BackupRunningRestore) { + v.value = val + v.isSet = true +} + +func (v NullableBackupRunningRestore) IsSet() bool { + return v.isSet +} + +func (v *NullableBackupRunningRestore) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackupRunningRestore(val *BackupRunningRestore) *NullableBackupRunningRestore { + return &NullableBackupRunningRestore{value: val, isSet: true} +} + +func (v NullableBackupRunningRestore) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackupRunningRestore) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3beta1api/model_backup_sort.go b/services/sqlserverflex/v3beta1api/model_backup_sort.go new file mode 100644 index 000000000..e404a1ffc --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_backup_sort.go @@ -0,0 +1,131 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +import ( + "encoding/json" + "fmt" +) + +// BackupSort the model 'BackupSort' +type BackupSort string + +// List of backup.sort +const ( + BACKUPSORT_END_TIME_DESC BackupSort = "end_time.desc" + BACKUPSORT_END_TIME_ASC BackupSort = "end_time.asc" + BACKUPSORT_INDEX_DESC BackupSort = "index.desc" + BACKUPSORT_INDEX_ASC BackupSort = "index.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{ + "end_time.desc", + "end_time.asc", + "index.desc", + "index.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/sqlserverflex/v3beta1api/model_create_database_request_payload.go b/services/sqlserverflex/v3beta1api/model_create_database_request_payload.go new file mode 100644 index 000000000..0dce612d0 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_create_database_request_payload.go @@ -0,0 +1,261 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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 collation of the database. This database collation should match the *collation_name* of one of the collations given by the **Get database collation list** endpoint. + Collation *string `json:"collation,omitempty"` + // CompatibilityLevel of the Database. + Compatibility *int32 `json:"compatibility,omitempty"` + // The name of the database. + Name string `json:"name"` + // The owner of the database. + Owner string `json:"owner"` +} + +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, owner string) *CreateDatabaseRequestPayload { + this := CreateDatabaseRequestPayload{} + this.Name = name + this.Owner = owner + 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 +} + +// GetCollation returns the Collation field value if set, zero value otherwise. +func (o *CreateDatabaseRequestPayload) GetCollation() string { + if o == nil || IsNil(o.Collation) { + var ret string + return ret + } + return *o.Collation +} + +// GetCollationOk returns a tuple with the Collation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateDatabaseRequestPayload) GetCollationOk() (*string, bool) { + if o == nil || IsNil(o.Collation) { + return nil, false + } + return o.Collation, true +} + +// HasCollation returns a boolean if a field has been set. +func (o *CreateDatabaseRequestPayload) HasCollation() bool { + if o != nil && !IsNil(o.Collation) { + return true + } + + return false +} + +// SetCollation gets a reference to the given string and assigns it to the Collation field. +func (o *CreateDatabaseRequestPayload) SetCollation(v string) { + o.Collation = &v +} + +// GetCompatibility returns the Compatibility field value if set, zero value otherwise. +func (o *CreateDatabaseRequestPayload) GetCompatibility() int32 { + if o == nil || IsNil(o.Compatibility) { + var ret int32 + return ret + } + return *o.Compatibility +} + +// GetCompatibilityOk returns a tuple with the Compatibility field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateDatabaseRequestPayload) GetCompatibilityOk() (*int32, bool) { + if o == nil || IsNil(o.Compatibility) { + return nil, false + } + return o.Compatibility, true +} + +// HasCompatibility returns a boolean if a field has been set. +func (o *CreateDatabaseRequestPayload) HasCompatibility() bool { + if o != nil && !IsNil(o.Compatibility) { + return true + } + + return false +} + +// SetCompatibility gets a reference to the given int32 and assigns it to the Compatibility field. +func (o *CreateDatabaseRequestPayload) SetCompatibility(v int32) { + o.Compatibility = &v +} + +// 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 +func (o *CreateDatabaseRequestPayload) 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 *CreateDatabaseRequestPayload) GetOwnerOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Owner, true +} + +// SetOwner sets field value +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{}{} + if !IsNil(o.Collation) { + toSerialize["collation"] = o.Collation + } + if !IsNil(o.Compatibility) { + toSerialize["compatibility"] = o.Compatibility + } + toSerialize["name"] = o.Name + 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", + "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) + } + } + + 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/sqlserverflex/v3beta1api/model_create_database_response.go b/services/sqlserverflex/v3beta1api/model_create_database_response.go new file mode 100644 index 000000000..3d6973e1f --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_create_database_response.go @@ -0,0 +1,158 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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 int64 `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 int64) *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() int64 { + if o == nil { + var ret int64 + 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() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CreateDatabaseResponse) SetId(v int64) { + 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/sqlserverflex/v3beta1api/model_create_instance_request_payload.go b/services/sqlserverflex/v3beta1api/model_create_instance_request_payload.go new file mode 100644 index 000000000..85d32103c --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_create_instance_request_payload.go @@ -0,0 +1,365 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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 on what time and how often the database backup will be created. 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 CreateInstanceRequestPayloadNetwork `json:"network"` + // The days for how long the backup files should be stored before cleaned up. 30 to 365 + RetentionDays int32 `json:"retentionDays"` + Storage StorageCreate `json:"storage"` + Version InstanceVersion `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 CreateInstanceRequestPayloadNetwork, retentionDays int32, storage StorageCreate, version InstanceVersion) *CreateInstanceRequestPayload { + this := CreateInstanceRequestPayload{} + this.BackupSchedule = backupSchedule + this.FlavorId = flavorId + this.Name = name + this.Network = network + 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() CreateInstanceRequestPayloadNetwork { + if o == nil { + var ret CreateInstanceRequestPayloadNetwork + 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() (*CreateInstanceRequestPayloadNetwork, bool) { + if o == nil { + return nil, false + } + return &o.Network, true +} + +// SetNetwork sets field value +func (o *CreateInstanceRequestPayload) SetNetwork(v CreateInstanceRequestPayloadNetwork) { + o.Network = 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() InstanceVersion { + if o == nil { + var ret InstanceVersion + 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() (*InstanceVersion, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *CreateInstanceRequestPayload) SetVersion(v InstanceVersion) { + 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["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", + "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/sqlserverflex/v3beta1api/model_create_instance_request_payload_network.go b/services/sqlserverflex/v3beta1api/model_create_instance_request_payload_network.go new file mode 100644 index 000000000..3dee9a3a5 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_create_instance_request_payload_network.go @@ -0,0 +1,198 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateInstanceRequestPayloadNetwork type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateInstanceRequestPayloadNetwork{} + +// CreateInstanceRequestPayloadNetwork the network configuration of the instance. +type CreateInstanceRequestPayloadNetwork struct { + AccessScope *InstanceNetworkAccessScope `json:"accessScope,omitempty"` + // List of IPV4 cidr. + Acl []string `json:"acl"` +} + +type _CreateInstanceRequestPayloadNetwork CreateInstanceRequestPayloadNetwork + +// NewCreateInstanceRequestPayloadNetwork instantiates a new CreateInstanceRequestPayloadNetwork object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateInstanceRequestPayloadNetwork(acl []string) *CreateInstanceRequestPayloadNetwork { + this := CreateInstanceRequestPayloadNetwork{} + var accessScope InstanceNetworkAccessScope = INSTANCENETWORKACCESSSCOPE_PUBLIC + this.AccessScope = &accessScope + this.Acl = acl + return &this +} + +// NewCreateInstanceRequestPayloadNetworkWithDefaults instantiates a new CreateInstanceRequestPayloadNetwork object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateInstanceRequestPayloadNetworkWithDefaults() *CreateInstanceRequestPayloadNetwork { + this := CreateInstanceRequestPayloadNetwork{} + var accessScope InstanceNetworkAccessScope = INSTANCENETWORKACCESSSCOPE_PUBLIC + this.AccessScope = &accessScope + return &this +} + +// GetAccessScope returns the AccessScope field value if set, zero value otherwise. +func (o *CreateInstanceRequestPayloadNetwork) 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 *CreateInstanceRequestPayloadNetwork) 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 *CreateInstanceRequestPayloadNetwork) 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 *CreateInstanceRequestPayloadNetwork) SetAccessScope(v InstanceNetworkAccessScope) { + o.AccessScope = &v +} + +// GetAcl returns the Acl field value +func (o *CreateInstanceRequestPayloadNetwork) 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 *CreateInstanceRequestPayloadNetwork) GetAclOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Acl, true +} + +// SetAcl sets field value +func (o *CreateInstanceRequestPayloadNetwork) SetAcl(v []string) { + o.Acl = v +} + +func (o CreateInstanceRequestPayloadNetwork) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateInstanceRequestPayloadNetwork) 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 *CreateInstanceRequestPayloadNetwork) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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) + } + } + + varCreateInstanceRequestPayloadNetwork := _CreateInstanceRequestPayloadNetwork{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateInstanceRequestPayloadNetwork) + + if err != nil { + return err + } + + *o = CreateInstanceRequestPayloadNetwork(varCreateInstanceRequestPayloadNetwork) + + return err +} + +type NullableCreateInstanceRequestPayloadNetwork struct { + value *CreateInstanceRequestPayloadNetwork + isSet bool +} + +func (v NullableCreateInstanceRequestPayloadNetwork) Get() *CreateInstanceRequestPayloadNetwork { + return v.value +} + +func (v *NullableCreateInstanceRequestPayloadNetwork) Set(val *CreateInstanceRequestPayloadNetwork) { + v.value = val + v.isSet = true +} + +func (v NullableCreateInstanceRequestPayloadNetwork) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateInstanceRequestPayloadNetwork) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateInstanceRequestPayloadNetwork(val *CreateInstanceRequestPayloadNetwork) *NullableCreateInstanceRequestPayloadNetwork { + return &NullableCreateInstanceRequestPayloadNetwork{value: val, isSet: true} +} + +func (v NullableCreateInstanceRequestPayloadNetwork) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateInstanceRequestPayloadNetwork) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3beta1api/model_create_instance_response.go b/services/sqlserverflex/v3beta1api/model_create_instance_response.go new file mode 100644 index 000000000..9d719f07d --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_create_instance_response.go @@ -0,0 +1,158 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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/sqlserverflex/v3beta1api/model_create_user_request_payload.go b/services/sqlserverflex/v3beta1api/model_create_user_request_payload.go new file mode 100644 index 000000000..ebe840844 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_create_user_request_payload.go @@ -0,0 +1,224 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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 default database for a user of the instance. + DefaultDatabase *string `json:"default_database,omitempty"` + // A list containing the user roles for the instance. A list with the valid user roles can be retrieved using the List Roles endpoint. + Roles []string `json:"roles"` + // The name of the user. + Username string `json:"username"` +} + +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(roles []string, username string) *CreateUserRequestPayload { + this := CreateUserRequestPayload{} + this.Roles = roles + this.Username = username + 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 +} + +// GetDefaultDatabase returns the DefaultDatabase field value if set, zero value otherwise. +func (o *CreateUserRequestPayload) GetDefaultDatabase() string { + if o == nil || IsNil(o.DefaultDatabase) { + var ret string + return ret + } + return *o.DefaultDatabase +} + +// GetDefaultDatabaseOk returns a tuple with the DefaultDatabase field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateUserRequestPayload) GetDefaultDatabaseOk() (*string, bool) { + if o == nil || IsNil(o.DefaultDatabase) { + return nil, false + } + return o.DefaultDatabase, true +} + +// HasDefaultDatabase returns a boolean if a field has been set. +func (o *CreateUserRequestPayload) HasDefaultDatabase() bool { + if o != nil && !IsNil(o.DefaultDatabase) { + return true + } + + return false +} + +// SetDefaultDatabase gets a reference to the given string and assigns it to the DefaultDatabase field. +func (o *CreateUserRequestPayload) SetDefaultDatabase(v string) { + o.DefaultDatabase = &v +} + +// GetRoles returns the Roles field value +func (o *CreateUserRequestPayload) 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 *CreateUserRequestPayload) GetRolesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Roles, true +} + +// SetRoles sets field value +func (o *CreateUserRequestPayload) SetRoles(v []string) { + o.Roles = v +} + +// GetUsername returns the Username field value +func (o *CreateUserRequestPayload) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *CreateUserRequestPayload) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *CreateUserRequestPayload) SetUsername(v string) { + o.Username = 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{}{} + if !IsNil(o.DefaultDatabase) { + toSerialize["default_database"] = o.DefaultDatabase + } + toSerialize["roles"] = o.Roles + toSerialize["username"] = o.Username + 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{ + "roles", + "username", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if 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/sqlserverflex/v3beta1api/model_create_user_response.go b/services/sqlserverflex/v3beta1api/model_create_user_response.go new file mode 100644 index 000000000..644cb2e90 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_create_user_response.go @@ -0,0 +1,389 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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 default database for a user of the instance. + DefaultDatabase string `json:"default_database"` + // The host of the instance in which the user belongs to. + Host string `json:"host"` + // The ID of the user. + Id int64 `json:"id"` + // The password for the user. + Password string `json:"password"` + // The port of the instance in which the user belongs to. + Port int32 `json:"port"` + Roles []string `json:"roles"` + // The current status of the user. + Status string `json:"status"` + // The connection string for the user to the instance. + Uri string `json:"uri"` + // The name of the user. + Username string `json:"username"` +} + +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(defaultDatabase string, host string, id int64, password string, port int32, roles []string, status string, uri string, username string) *CreateUserResponse { + this := CreateUserResponse{} + this.DefaultDatabase = defaultDatabase + this.Host = host + this.Id = id + this.Password = password + this.Port = port + this.Roles = roles + this.Status = status + this.Uri = uri + this.Username = username + 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 +} + +// GetDefaultDatabase returns the DefaultDatabase field value +func (o *CreateUserResponse) GetDefaultDatabase() string { + if o == nil { + var ret string + return ret + } + + return o.DefaultDatabase +} + +// GetDefaultDatabaseOk returns a tuple with the DefaultDatabase field value +// and a boolean to check if the value has been set. +func (o *CreateUserResponse) GetDefaultDatabaseOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DefaultDatabase, true +} + +// SetDefaultDatabase sets field value +func (o *CreateUserResponse) SetDefaultDatabase(v string) { + o.DefaultDatabase = v +} + +// GetHost returns the Host field value +func (o *CreateUserResponse) 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 *CreateUserResponse) GetHostOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Host, true +} + +// SetHost sets field value +func (o *CreateUserResponse) SetHost(v string) { + o.Host = v +} + +// GetId returns the Id field value +func (o *CreateUserResponse) GetId() int64 { + if o == nil { + var ret int64 + 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() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CreateUserResponse) SetId(v int64) { + o.Id = 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 +} + +// GetPort returns the Port field value +func (o *CreateUserResponse) 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 *CreateUserResponse) GetPortOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Port, true +} + +// SetPort sets field value +func (o *CreateUserResponse) SetPort(v int32) { + o.Port = v +} + +// GetRoles returns the Roles field value +func (o *CreateUserResponse) 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 *CreateUserResponse) GetRolesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Roles, true +} + +// SetRoles sets field value +func (o *CreateUserResponse) SetRoles(v []string) { + o.Roles = 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 +} + +// GetUri returns the Uri field value +func (o *CreateUserResponse) GetUri() string { + if o == nil { + var ret string + return ret + } + + return o.Uri +} + +// GetUriOk returns a tuple with the Uri field value +// and a boolean to check if the value has been set. +func (o *CreateUserResponse) GetUriOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Uri, true +} + +// SetUri sets field value +func (o *CreateUserResponse) SetUri(v string) { + o.Uri = v +} + +// GetUsername returns the Username field value +func (o *CreateUserResponse) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *CreateUserResponse) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *CreateUserResponse) SetUsername(v string) { + o.Username = 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["default_database"] = o.DefaultDatabase + toSerialize["host"] = o.Host + toSerialize["id"] = o.Id + toSerialize["password"] = o.Password + toSerialize["port"] = o.Port + toSerialize["roles"] = o.Roles + toSerialize["status"] = o.Status + toSerialize["uri"] = o.Uri + toSerialize["username"] = o.Username + 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{ + "default_database", + "host", + "id", + "password", + "port", + "roles", + "status", + "uri", + "username", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if 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/sqlserverflex/v3beta1api/model_database_getcollation.go b/services/sqlserverflex/v3beta1api/model_database_getcollation.go new file mode 100644 index 000000000..19f677a6f --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_database_getcollation.go @@ -0,0 +1,161 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +import ( + "encoding/json" +) + +// checks if the DatabaseGetcollation type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DatabaseGetcollation{} + +// DatabaseGetcollation struct for DatabaseGetcollation +type DatabaseGetcollation struct { + CollationName *string `json:"collation_name,omitempty"` + Description *string `json:"description,omitempty"` +} + +// NewDatabaseGetcollation instantiates a new DatabaseGetcollation object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDatabaseGetcollation() *DatabaseGetcollation { + this := DatabaseGetcollation{} + return &this +} + +// NewDatabaseGetcollationWithDefaults instantiates a new DatabaseGetcollation object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDatabaseGetcollationWithDefaults() *DatabaseGetcollation { + this := DatabaseGetcollation{} + return &this +} + +// GetCollationName returns the CollationName field value if set, zero value otherwise. +func (o *DatabaseGetcollation) GetCollationName() string { + if o == nil || IsNil(o.CollationName) { + var ret string + return ret + } + return *o.CollationName +} + +// GetCollationNameOk returns a tuple with the CollationName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DatabaseGetcollation) GetCollationNameOk() (*string, bool) { + if o == nil || IsNil(o.CollationName) { + return nil, false + } + return o.CollationName, true +} + +// HasCollationName returns a boolean if a field has been set. +func (o *DatabaseGetcollation) HasCollationName() bool { + if o != nil && !IsNil(o.CollationName) { + return true + } + + return false +} + +// SetCollationName gets a reference to the given string and assigns it to the CollationName field. +func (o *DatabaseGetcollation) SetCollationName(v string) { + o.CollationName = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *DatabaseGetcollation) 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 *DatabaseGetcollation) 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 *DatabaseGetcollation) 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 *DatabaseGetcollation) SetDescription(v string) { + o.Description = &v +} + +func (o DatabaseGetcollation) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DatabaseGetcollation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CollationName) { + toSerialize["collation_name"] = o.CollationName + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + return toSerialize, nil +} + +type NullableDatabaseGetcollation struct { + value *DatabaseGetcollation + isSet bool +} + +func (v NullableDatabaseGetcollation) Get() *DatabaseGetcollation { + return v.value +} + +func (v *NullableDatabaseGetcollation) Set(val *DatabaseGetcollation) { + v.value = val + v.isSet = true +} + +func (v NullableDatabaseGetcollation) IsSet() bool { + return v.isSet +} + +func (v *NullableDatabaseGetcollation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDatabaseGetcollation(val *DatabaseGetcollation) *NullableDatabaseGetcollation { + return &NullableDatabaseGetcollation{value: val, isSet: true} +} + +func (v NullableDatabaseGetcollation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDatabaseGetcollation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3beta1api/model_database_getcompatibility.go b/services/sqlserverflex/v3beta1api/model_database_getcompatibility.go new file mode 100644 index 000000000..cb718db3f --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_database_getcompatibility.go @@ -0,0 +1,161 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +import ( + "encoding/json" +) + +// checks if the DatabaseGetcompatibility type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DatabaseGetcompatibility{} + +// DatabaseGetcompatibility struct for DatabaseGetcompatibility +type DatabaseGetcompatibility struct { + CompatibilityLevel *int32 `json:"compatibility_level,omitempty"` + Description *string `json:"description,omitempty"` +} + +// NewDatabaseGetcompatibility instantiates a new DatabaseGetcompatibility object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDatabaseGetcompatibility() *DatabaseGetcompatibility { + this := DatabaseGetcompatibility{} + return &this +} + +// NewDatabaseGetcompatibilityWithDefaults instantiates a new DatabaseGetcompatibility object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDatabaseGetcompatibilityWithDefaults() *DatabaseGetcompatibility { + this := DatabaseGetcompatibility{} + return &this +} + +// GetCompatibilityLevel returns the CompatibilityLevel field value if set, zero value otherwise. +func (o *DatabaseGetcompatibility) GetCompatibilityLevel() int32 { + if o == nil || IsNil(o.CompatibilityLevel) { + var ret int32 + return ret + } + return *o.CompatibilityLevel +} + +// GetCompatibilityLevelOk returns a tuple with the CompatibilityLevel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DatabaseGetcompatibility) GetCompatibilityLevelOk() (*int32, bool) { + if o == nil || IsNil(o.CompatibilityLevel) { + return nil, false + } + return o.CompatibilityLevel, true +} + +// HasCompatibilityLevel returns a boolean if a field has been set. +func (o *DatabaseGetcompatibility) HasCompatibilityLevel() bool { + if o != nil && !IsNil(o.CompatibilityLevel) { + return true + } + + return false +} + +// SetCompatibilityLevel gets a reference to the given int32 and assigns it to the CompatibilityLevel field. +func (o *DatabaseGetcompatibility) SetCompatibilityLevel(v int32) { + o.CompatibilityLevel = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *DatabaseGetcompatibility) 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 *DatabaseGetcompatibility) 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 *DatabaseGetcompatibility) 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 *DatabaseGetcompatibility) SetDescription(v string) { + o.Description = &v +} + +func (o DatabaseGetcompatibility) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DatabaseGetcompatibility) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CompatibilityLevel) { + toSerialize["compatibility_level"] = o.CompatibilityLevel + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + return toSerialize, nil +} + +type NullableDatabaseGetcompatibility struct { + value *DatabaseGetcompatibility + isSet bool +} + +func (v NullableDatabaseGetcompatibility) Get() *DatabaseGetcompatibility { + return v.value +} + +func (v *NullableDatabaseGetcompatibility) Set(val *DatabaseGetcompatibility) { + v.value = val + v.isSet = true +} + +func (v NullableDatabaseGetcompatibility) IsSet() bool { + return v.isSet +} + +func (v *NullableDatabaseGetcompatibility) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDatabaseGetcompatibility(val *DatabaseGetcompatibility) *NullableDatabaseGetcompatibility { + return &NullableDatabaseGetcompatibility{value: val, isSet: true} +} + +func (v NullableDatabaseGetcompatibility) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDatabaseGetcompatibility) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3beta1api/model_database_roles.go b/services/sqlserverflex/v3beta1api/model_database_roles.go new file mode 100644 index 000000000..457de8bcb --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_database_roles.go @@ -0,0 +1,187 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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/sqlserverflex/v3beta1api/model_database_sort.go b/services/sqlserverflex/v3beta1api/model_database_sort.go new file mode 100644 index 000000000..7d6172f27 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_database_sort.go @@ -0,0 +1,127 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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" + DATABASESORT_INDEX_ASC DatabaseSort = "index.asc" + DATABASESORT_INDEX_DESC DatabaseSort = "index.desc" +) + +// 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", + "index.asc", + "index.desc", +} + +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/sqlserverflex/v3beta1api/model_error.go b/services/sqlserverflex/v3beta1api/model_error.go new file mode 100644 index 000000000..ba5b2b3be --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_error.go @@ -0,0 +1,245 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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" validate:"required,errorCode"` + // More detailed information about the error. + Message string `json:"message" validate:"required,errorMsg"` + // The trace id of the request. + TraceId string `json:"traceId" validate:"required,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/sqlserverflex/v3beta1api/model_external_s3.go b/services/sqlserverflex/v3beta1api/model_external_s3.go new file mode 100644 index 000000000..144bec0b9 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_external_s3.go @@ -0,0 +1,245 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ExternalS3 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ExternalS3{} + +// ExternalS3 The external S3 information +type ExternalS3 struct { + // The s3 access key id + S3AccessKey string `json:"s3_access_key"` + // The s3 access secret + S3AccessSecret string `json:"s3_access_secret"` + // The s3 bucket address + S3Bucket string `json:"s3_bucket"` + // The backup files from which the database should be restored + S3Files []S3fileInfo `json:"s3_files"` +} + +type _ExternalS3 ExternalS3 + +// NewExternalS3 instantiates a new ExternalS3 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewExternalS3(s3AccessKey string, s3AccessSecret string, s3Bucket string, s3Files []S3fileInfo) *ExternalS3 { + this := ExternalS3{} + this.S3AccessKey = s3AccessKey + this.S3AccessSecret = s3AccessSecret + this.S3Bucket = s3Bucket + this.S3Files = s3Files + return &this +} + +// NewExternalS3WithDefaults instantiates a new ExternalS3 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewExternalS3WithDefaults() *ExternalS3 { + this := ExternalS3{} + return &this +} + +// GetS3AccessKey returns the S3AccessKey field value +func (o *ExternalS3) GetS3AccessKey() string { + if o == nil { + var ret string + return ret + } + + return o.S3AccessKey +} + +// GetS3AccessKeyOk returns a tuple with the S3AccessKey field value +// and a boolean to check if the value has been set. +func (o *ExternalS3) GetS3AccessKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.S3AccessKey, true +} + +// SetS3AccessKey sets field value +func (o *ExternalS3) SetS3AccessKey(v string) { + o.S3AccessKey = v +} + +// GetS3AccessSecret returns the S3AccessSecret field value +func (o *ExternalS3) GetS3AccessSecret() string { + if o == nil { + var ret string + return ret + } + + return o.S3AccessSecret +} + +// GetS3AccessSecretOk returns a tuple with the S3AccessSecret field value +// and a boolean to check if the value has been set. +func (o *ExternalS3) GetS3AccessSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.S3AccessSecret, true +} + +// SetS3AccessSecret sets field value +func (o *ExternalS3) SetS3AccessSecret(v string) { + o.S3AccessSecret = v +} + +// GetS3Bucket returns the S3Bucket field value +func (o *ExternalS3) GetS3Bucket() string { + if o == nil { + var ret string + return ret + } + + return o.S3Bucket +} + +// GetS3BucketOk returns a tuple with the S3Bucket field value +// and a boolean to check if the value has been set. +func (o *ExternalS3) GetS3BucketOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.S3Bucket, true +} + +// SetS3Bucket sets field value +func (o *ExternalS3) SetS3Bucket(v string) { + o.S3Bucket = v +} + +// GetS3Files returns the S3Files field value +func (o *ExternalS3) GetS3Files() []S3fileInfo { + if o == nil { + var ret []S3fileInfo + return ret + } + + return o.S3Files +} + +// GetS3FilesOk returns a tuple with the S3Files field value +// and a boolean to check if the value has been set. +func (o *ExternalS3) GetS3FilesOk() ([]S3fileInfo, bool) { + if o == nil { + return nil, false + } + return o.S3Files, true +} + +// SetS3Files sets field value +func (o *ExternalS3) SetS3Files(v []S3fileInfo) { + o.S3Files = v +} + +func (o ExternalS3) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ExternalS3) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["s3_access_key"] = o.S3AccessKey + toSerialize["s3_access_secret"] = o.S3AccessSecret + toSerialize["s3_bucket"] = o.S3Bucket + toSerialize["s3_files"] = o.S3Files + return toSerialize, nil +} + +func (o *ExternalS3) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "s3_access_key", + "s3_access_secret", + "s3_bucket", + "s3_files", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varExternalS3 := _ExternalS3{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varExternalS3) + + if err != nil { + return err + } + + *o = ExternalS3(varExternalS3) + + return err +} + +type NullableExternalS3 struct { + value *ExternalS3 + isSet bool +} + +func (v NullableExternalS3) Get() *ExternalS3 { + return v.value +} + +func (v *NullableExternalS3) Set(val *ExternalS3) { + v.value = val + v.isSet = true +} + +func (v NullableExternalS3) IsSet() bool { + return v.isSet +} + +func (v *NullableExternalS3) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableExternalS3(val *ExternalS3) *NullableExternalS3 { + return &NullableExternalS3{value: val, isSet: true} +} + +func (v NullableExternalS3) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableExternalS3) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3beta1api/model_flavor_sort.go b/services/sqlserverflex/v3beta1api/model_flavor_sort.go new file mode 100644 index 000000000..e7147c915 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_flavor_sort.go @@ -0,0 +1,143 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +import ( + "encoding/json" + "fmt" +) + +// FlavorSort the model 'FlavorSort' +type FlavorSort string + +// List of flavor.sort +const ( + FLAVORSORT_INDEX_DESC FlavorSort = "index.desc" + FLAVORSORT_INDEX_ASC FlavorSort = "index.asc" + 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{ + "index.desc", + "index.asc", + "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/sqlserverflex/v3beta1api/model_flavor_storage_classes_storage_class.go b/services/sqlserverflex/v3beta1api/model_flavor_storage_classes_storage_class.go new file mode 100644 index 000000000..adf1ac59b --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_flavor_storage_classes_storage_class.go @@ -0,0 +1,213 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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/sqlserverflex/v3beta1api/model_flavor_storage_range.go b/services/sqlserverflex/v3beta1api/model_flavor_storage_range.go new file mode 100644 index 000000000..16e4067fb --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_flavor_storage_range.go @@ -0,0 +1,187 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the FlavorStorageRange type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FlavorStorageRange{} + +// FlavorStorageRange range of maximum and minimum storage which can be ordered for the flavor in Gigabyte. +type FlavorStorageRange struct { + // maximum storage which can be ordered for the flavor in Gigabyte. + Max int32 `json:"max"` + // minimum storage which is required to order in Gigabyte. + Min int32 `json:"min"` +} + +type _FlavorStorageRange FlavorStorageRange + +// NewFlavorStorageRange instantiates a new FlavorStorageRange object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFlavorStorageRange(max int32, min int32) *FlavorStorageRange { + this := FlavorStorageRange{} + this.Max = max + this.Min = min + return &this +} + +// NewFlavorStorageRangeWithDefaults instantiates a new FlavorStorageRange object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFlavorStorageRangeWithDefaults() *FlavorStorageRange { + this := FlavorStorageRange{} + return &this +} + +// GetMax returns the Max field value +func (o *FlavorStorageRange) 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 *FlavorStorageRange) GetMaxOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Max, true +} + +// SetMax sets field value +func (o *FlavorStorageRange) SetMax(v int32) { + o.Max = v +} + +// GetMin returns the Min field value +func (o *FlavorStorageRange) 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 *FlavorStorageRange) GetMinOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Min, true +} + +// SetMin sets field value +func (o *FlavorStorageRange) SetMin(v int32) { + o.Min = v +} + +func (o FlavorStorageRange) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FlavorStorageRange) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["max"] = o.Max + toSerialize["min"] = o.Min + return toSerialize, nil +} + +func (o *FlavorStorageRange) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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) + } + } + + varFlavorStorageRange := _FlavorStorageRange{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varFlavorStorageRange) + + if err != nil { + return err + } + + *o = FlavorStorageRange(varFlavorStorageRange) + + return err +} + +type NullableFlavorStorageRange struct { + value *FlavorStorageRange + isSet bool +} + +func (v NullableFlavorStorageRange) Get() *FlavorStorageRange { + return v.value +} + +func (v *NullableFlavorStorageRange) Set(val *FlavorStorageRange) { + v.value = val + v.isSet = true +} + +func (v NullableFlavorStorageRange) IsSet() bool { + return v.isSet +} + +func (v *NullableFlavorStorageRange) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFlavorStorageRange(val *FlavorStorageRange) *NullableFlavorStorageRange { + return &NullableFlavorStorageRange{value: val, isSet: true} +} + +func (v NullableFlavorStorageRange) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFlavorStorageRange) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3beta1api/model_get_backup_response.go b/services/sqlserverflex/v3beta1api/model_get_backup_response.go new file mode 100644 index 000000000..800831857 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_get_backup_response.go @@ -0,0 +1,303 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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 int64 `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 int64 `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 int64, name string, retainedUntil string, size int64, 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() int64 { + if o == nil { + var ret int64 + 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() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *GetBackupResponse) SetId(v int64) { + 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() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value +// and a boolean to check if the value has been set. +func (o *GetBackupResponse) GetSizeOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value +func (o *GetBackupResponse) SetSize(v int64) { + 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/sqlserverflex/v3beta1api/model_get_collations_response.go b/services/sqlserverflex/v3beta1api/model_get_collations_response.go new file mode 100644 index 000000000..413c3f04c --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_get_collations_response.go @@ -0,0 +1,158 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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 []DatabaseGetcollation `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 []DatabaseGetcollation) *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() []DatabaseGetcollation { + if o == nil { + var ret []DatabaseGetcollation + 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() ([]DatabaseGetcollation, bool) { + if o == nil { + return nil, false + } + return o.Collations, true +} + +// SetCollations sets field value +func (o *GetCollationsResponse) SetCollations(v []DatabaseGetcollation) { + 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/sqlserverflex/v3beta1api/model_get_database_response.go b/services/sqlserverflex/v3beta1api/model_get_database_response.go new file mode 100644 index 000000000..4f8e53fdc --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_get_database_response.go @@ -0,0 +1,274 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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 collation of the database. This database collation should match the *collation_name* of one of the collations given by the **Get database collation list** endpoint. + CollationName string `json:"collationName"` + // CompatibilityLevel of the Database. + CompatibilityLevel int32 `json:"compatibilityLevel"` + // The id of the database. + Id int64 `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(collationName string, compatibilityLevel int32, id int64, name string, owner string) *GetDatabaseResponse { + this := GetDatabaseResponse{} + this.CollationName = collationName + this.CompatibilityLevel = compatibilityLevel + 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 +} + +// GetCollationName returns the CollationName field value +func (o *GetDatabaseResponse) GetCollationName() string { + if o == nil { + var ret string + return ret + } + + return o.CollationName +} + +// GetCollationNameOk returns a tuple with the CollationName field value +// and a boolean to check if the value has been set. +func (o *GetDatabaseResponse) GetCollationNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CollationName, true +} + +// SetCollationName sets field value +func (o *GetDatabaseResponse) SetCollationName(v string) { + o.CollationName = v +} + +// GetCompatibilityLevel returns the CompatibilityLevel field value +func (o *GetDatabaseResponse) GetCompatibilityLevel() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.CompatibilityLevel +} + +// GetCompatibilityLevelOk returns a tuple with the CompatibilityLevel field value +// and a boolean to check if the value has been set. +func (o *GetDatabaseResponse) GetCompatibilityLevelOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.CompatibilityLevel, true +} + +// SetCompatibilityLevel sets field value +func (o *GetDatabaseResponse) SetCompatibilityLevel(v int32) { + o.CompatibilityLevel = v +} + +// GetId returns the Id field value +func (o *GetDatabaseResponse) GetId() int64 { + if o == nil { + var ret int64 + 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() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *GetDatabaseResponse) SetId(v int64) { + 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["collationName"] = o.CollationName + toSerialize["compatibilityLevel"] = o.CompatibilityLevel + 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{ + "collationName", + "compatibilityLevel", + "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/sqlserverflex/v3beta1api/model_get_flavors_response.go b/services/sqlserverflex/v3beta1api/model_get_flavors_response.go new file mode 100644 index 000000000..184b4c597 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_get_flavors_response.go @@ -0,0 +1,186 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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/sqlserverflex/v3beta1api/model_get_instance_response.go b/services/sqlserverflex/v3beta1api/model_get_instance_response.go new file mode 100644 index 000000000..16450023f --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_get_instance_response.go @@ -0,0 +1,507 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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 { + // The schedule for on what time and how often the database backup will be created. The schedule is written as a cron schedule. + BackupSchedule string `json:"backupSchedule"` + Edition InstanceEdition `json:"edition"` + 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"` + // The days for how long the backup files should be stored before cleaned up. 30 to 365 + RetentionDays int32 `json:"retentionDays"` + Status Status `json:"status"` + Storage Storage `json:"storage"` + Version InstanceVersion `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, edition InstanceEdition, flavorId string, id string, isDeletable bool, name string, network InstanceNetwork, replicas Replicas, retentionDays int32, status Status, storage Storage, version InstanceVersion) *GetInstanceResponse { + this := GetInstanceResponse{} + this.BackupSchedule = backupSchedule + this.Edition = edition + 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 +} + +// 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 +} + +// GetEdition returns the Edition field value +func (o *GetInstanceResponse) GetEdition() InstanceEdition { + if o == nil { + var ret InstanceEdition + return ret + } + + return o.Edition +} + +// GetEditionOk returns a tuple with the Edition field value +// and a boolean to check if the value has been set. +func (o *GetInstanceResponse) GetEditionOk() (*InstanceEdition, bool) { + if o == nil { + return nil, false + } + return &o.Edition, true +} + +// SetEdition sets field value +func (o *GetInstanceResponse) SetEdition(v InstanceEdition) { + o.Edition = 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() InstanceVersion { + if o == nil { + var ret InstanceVersion + 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() (*InstanceVersion, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *GetInstanceResponse) SetVersion(v InstanceVersion) { + 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{}{} + toSerialize["backupSchedule"] = o.BackupSchedule + toSerialize["edition"] = o.Edition + 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", + "edition", + "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/sqlserverflex/v3beta1api/model_get_storages_response.go b/services/sqlserverflex/v3beta1api/model_get_storages_response.go new file mode 100644 index 000000000..d225c0305 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_get_storages_response.go @@ -0,0 +1,186 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GetStoragesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetStoragesResponse{} + +// GetStoragesResponse struct for GetStoragesResponse +type GetStoragesResponse struct { + // maximum storage which can be ordered for the flavor in Gigabyte. + StorageClasses []FlavorStorageClassesStorageClass `json:"storageClasses"` + StorageRange FlavorStorageRange `json:"storageRange"` +} + +type _GetStoragesResponse GetStoragesResponse + +// NewGetStoragesResponse instantiates a new GetStoragesResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetStoragesResponse(storageClasses []FlavorStorageClassesStorageClass, storageRange FlavorStorageRange) *GetStoragesResponse { + this := GetStoragesResponse{} + this.StorageClasses = storageClasses + this.StorageRange = storageRange + return &this +} + +// NewGetStoragesResponseWithDefaults instantiates a new GetStoragesResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetStoragesResponseWithDefaults() *GetStoragesResponse { + this := GetStoragesResponse{} + return &this +} + +// GetStorageClasses returns the StorageClasses field value +func (o *GetStoragesResponse) 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 *GetStoragesResponse) GetStorageClassesOk() ([]FlavorStorageClassesStorageClass, bool) { + if o == nil { + return nil, false + } + return o.StorageClasses, true +} + +// SetStorageClasses sets field value +func (o *GetStoragesResponse) SetStorageClasses(v []FlavorStorageClassesStorageClass) { + o.StorageClasses = v +} + +// GetStorageRange returns the StorageRange field value +func (o *GetStoragesResponse) GetStorageRange() FlavorStorageRange { + if o == nil { + var ret FlavorStorageRange + return ret + } + + return o.StorageRange +} + +// GetStorageRangeOk returns a tuple with the StorageRange field value +// and a boolean to check if the value has been set. +func (o *GetStoragesResponse) GetStorageRangeOk() (*FlavorStorageRange, bool) { + if o == nil { + return nil, false + } + return &o.StorageRange, true +} + +// SetStorageRange sets field value +func (o *GetStoragesResponse) SetStorageRange(v FlavorStorageRange) { + o.StorageRange = v +} + +func (o GetStoragesResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetStoragesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["storageClasses"] = o.StorageClasses + toSerialize["storageRange"] = o.StorageRange + return toSerialize, nil +} + +func (o *GetStoragesResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "storageClasses", + "storageRange", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetStoragesResponse := _GetStoragesResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetStoragesResponse) + + if err != nil { + return err + } + + *o = GetStoragesResponse(varGetStoragesResponse) + + return err +} + +type NullableGetStoragesResponse struct { + value *GetStoragesResponse + isSet bool +} + +func (v NullableGetStoragesResponse) Get() *GetStoragesResponse { + return v.value +} + +func (v *NullableGetStoragesResponse) Set(val *GetStoragesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetStoragesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetStoragesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetStoragesResponse(val *GetStoragesResponse) *NullableGetStoragesResponse { + return &NullableGetStoragesResponse{value: val, isSet: true} +} + +func (v NullableGetStoragesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetStoragesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3beta1api/model_get_user_response.go b/services/sqlserverflex/v3beta1api/model_get_user_response.go new file mode 100644 index 000000000..5050997ad --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_get_user_response.go @@ -0,0 +1,332 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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 default database for a user of the instance. + DefaultDatabase string `json:"default_database"` + // The host of the instance in which the user belongs to. + Host string `json:"host"` + // The ID of the user. + Id int64 `json:"id"` + // The port of the instance in which the user belongs to. + Port int32 `json:"port"` + // A list of user roles. + Roles []string `json:"roles"` + // The current status of the user. + Status string `json:"status"` + // The name of the user. + Username string `json:"username"` +} + +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(defaultDatabase string, host string, id int64, port int32, roles []string, status string, username string) *GetUserResponse { + this := GetUserResponse{} + this.DefaultDatabase = defaultDatabase + this.Host = host + this.Id = id + this.Port = port + this.Roles = roles + this.Status = status + this.Username = username + 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 +} + +// GetDefaultDatabase returns the DefaultDatabase field value +func (o *GetUserResponse) GetDefaultDatabase() string { + if o == nil { + var ret string + return ret + } + + return o.DefaultDatabase +} + +// GetDefaultDatabaseOk returns a tuple with the DefaultDatabase field value +// and a boolean to check if the value has been set. +func (o *GetUserResponse) GetDefaultDatabaseOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DefaultDatabase, true +} + +// SetDefaultDatabase sets field value +func (o *GetUserResponse) SetDefaultDatabase(v string) { + o.DefaultDatabase = v +} + +// GetHost returns the Host field value +func (o *GetUserResponse) 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 *GetUserResponse) GetHostOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Host, true +} + +// SetHost sets field value +func (o *GetUserResponse) SetHost(v string) { + o.Host = v +} + +// GetId returns the Id field value +func (o *GetUserResponse) GetId() int64 { + if o == nil { + var ret int64 + 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() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *GetUserResponse) SetId(v int64) { + o.Id = v +} + +// GetPort returns the Port field value +func (o *GetUserResponse) 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 *GetUserResponse) GetPortOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Port, true +} + +// SetPort sets field value +func (o *GetUserResponse) SetPort(v int32) { + o.Port = v +} + +// GetRoles returns the Roles field value +func (o *GetUserResponse) 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 *GetUserResponse) GetRolesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Roles, true +} + +// SetRoles sets field value +func (o *GetUserResponse) SetRoles(v []string) { + 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 +} + +// GetUsername returns the Username field value +func (o *GetUserResponse) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *GetUserResponse) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *GetUserResponse) SetUsername(v string) { + o.Username = 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["default_database"] = o.DefaultDatabase + toSerialize["host"] = o.Host + toSerialize["id"] = o.Id + toSerialize["port"] = o.Port + toSerialize["roles"] = o.Roles + toSerialize["status"] = o.Status + toSerialize["username"] = o.Username + 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{ + "default_database", + "host", + "id", + "port", + "roles", + "status", + "username", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if 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/sqlserverflex/v3beta1api/model_get_versions_response.go b/services/sqlserverflex/v3beta1api/model_get_versions_response.go new file mode 100644 index 000000000..a478d6e82 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_get_versions_response.go @@ -0,0 +1,158 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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 sqlserver 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/sqlserverflex/v3beta1api/model_instance_edition.go b/services/sqlserverflex/v3beta1api/model_instance_edition.go new file mode 100644 index 000000000..367ec8986 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_instance_edition.go @@ -0,0 +1,113 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +import ( + "encoding/json" + "fmt" +) + +// InstanceEdition Edition of the MSSQL server instance +type InstanceEdition string + +// List of instance.edition +const ( + INSTANCEEDITION_STANDARD InstanceEdition = "Standard" + INSTANCEEDITION_ENTERPRISE_CORE InstanceEdition = "EnterpriseCore" + INSTANCEEDITION_DEVELOPER InstanceEdition = "developer" +) + +// All allowed values of InstanceEdition enum +var AllowedInstanceEditionEnumValues = []InstanceEdition{ + "Standard", + "EnterpriseCore", + "developer", +} + +func (v *InstanceEdition) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceEdition(value) + for _, existing := range AllowedInstanceEditionEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InstanceEdition", value) +} + +// NewInstanceEditionFromValue returns a pointer to a valid InstanceEdition +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceEditionFromValue(v string) (*InstanceEdition, error) { + ev := InstanceEdition(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceEdition: valid values are %v", v, AllowedInstanceEditionEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceEdition) IsValid() bool { + for _, existing := range AllowedInstanceEditionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to instance.edition value +func (v InstanceEdition) Ptr() *InstanceEdition { + return &v +} + +type NullableInstanceEdition struct { + value *InstanceEdition + isSet bool +} + +func (v NullableInstanceEdition) Get() *InstanceEdition { + return v.value +} + +func (v *NullableInstanceEdition) Set(val *InstanceEdition) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceEdition) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceEdition) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceEdition(val *InstanceEdition) *NullableInstanceEdition { + return &NullableInstanceEdition{value: val, isSet: true} +} + +func (v NullableInstanceEdition) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceEdition) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3beta1api/model_instance_encryption.go b/services/sqlserverflex/v3beta1api/model_instance_encryption.go new file mode 100644 index 000000000..ce9dea28b --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_instance_encryption.go @@ -0,0 +1,244 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the InstanceEncryption type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceEncryption{} + +// InstanceEncryption this defines which key to use for storage encryption +type InstanceEncryption struct { + // The key identifier + KekKeyId string `json:"kekKeyId"` + // The keyring identifier + KekKeyRingId string `json:"kekKeyRingId"` + // The 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/sqlserverflex/v3beta1api/model_instance_network.go b/services/sqlserverflex/v3beta1api/model_instance_network.go new file mode 100644 index 000000000..5724e81a0 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_instance_network.go @@ -0,0 +1,238 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +import ( + "encoding/json" +) + +// 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,omitempty"` + InstanceAddress *string `json:"instanceAddress,omitempty"` + RouterAddress *string `json:"routerAddress,omitempty"` +} + +// 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() *InstanceNetwork { + this := InstanceNetwork{} + var accessScope InstanceNetworkAccessScope = INSTANCENETWORKACCESSSCOPE_PUBLIC + this.AccessScope = &accessScope + 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 if set, zero value otherwise. +func (o *InstanceNetwork) 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 *InstanceNetwork) 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 *InstanceNetwork) 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 *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 + } + if !IsNil(o.Acl) { + toSerialize["acl"] = o.Acl + } + if !IsNil(o.InstanceAddress) { + toSerialize["instanceAddress"] = o.InstanceAddress + } + if !IsNil(o.RouterAddress) { + toSerialize["routerAddress"] = o.RouterAddress + } + return toSerialize, nil +} + +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/sqlserverflex/v3beta1api/model_instance_network_access_scope.go b/services/sqlserverflex/v3beta1api/model_instance_network_access_scope.go new file mode 100644 index 000000000..6769797a3 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_instance_network_access_scope.go @@ -0,0 +1,111 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +import ( + "encoding/json" + "fmt" +) + +// InstanceNetworkAccessScope The network access scope of the instance ⚠️ **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 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/sqlserverflex/v3beta1api/model_instance_sort.go b/services/sqlserverflex/v3beta1api/model_instance_sort.go new file mode 100644 index 000000000..973418e72 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_instance_sort.go @@ -0,0 +1,127 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +import ( + "encoding/json" + "fmt" +) + +// InstanceSort the model 'InstanceSort' +type InstanceSort string + +// List of instance.sort +const ( + INSTANCESORT_INDEX_DESC InstanceSort = "index.desc" + INSTANCESORT_INDEX_ASC InstanceSort = "index.asc" + 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{ + "index.desc", + "index.asc", + "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/sqlserverflex/v3beta1api/model_instance_version.go b/services/sqlserverflex/v3beta1api/model_instance_version.go new file mode 100644 index 000000000..36b0aea28 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_instance_version.go @@ -0,0 +1,109 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +import ( + "encoding/json" + "fmt" +) + +// InstanceVersion The sqlserver version used for the instance. +type InstanceVersion string + +// List of instance.version +const ( + INSTANCEVERSION__2022 InstanceVersion = "2022" +) + +// All allowed values of InstanceVersion enum +var AllowedInstanceVersionEnumValues = []InstanceVersion{ + "2022", +} + +func (v *InstanceVersion) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceVersion(value) + for _, existing := range AllowedInstanceVersionEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InstanceVersion", value) +} + +// NewInstanceVersionFromValue returns a pointer to a valid InstanceVersion +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceVersionFromValue(v string) (*InstanceVersion, error) { + ev := InstanceVersion(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceVersion: valid values are %v", v, AllowedInstanceVersionEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceVersion) IsValid() bool { + for _, existing := range AllowedInstanceVersionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to instance.version value +func (v InstanceVersion) Ptr() *InstanceVersion { + return &v +} + +type NullableInstanceVersion struct { + value *InstanceVersion + isSet bool +} + +func (v NullableInstanceVersion) Get() *InstanceVersion { + return v.value +} + +func (v *NullableInstanceVersion) Set(val *InstanceVersion) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceVersion) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceVersion) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceVersion(val *InstanceVersion) *NullableInstanceVersion { + return &NullableInstanceVersion{value: val, isSet: true} +} + +func (v NullableInstanceVersion) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceVersion) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3beta1api/model_instance_version_opt.go b/services/sqlserverflex/v3beta1api/model_instance_version_opt.go new file mode 100644 index 000000000..8a40ce468 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_instance_version_opt.go @@ -0,0 +1,109 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +import ( + "encoding/json" + "fmt" +) + +// InstanceVersionOpt the model 'InstanceVersionOpt' +type InstanceVersionOpt string + +// List of instance.version.opt +const ( + INSTANCEVERSIONOPT__2022 InstanceVersionOpt = "2022" +) + +// All allowed values of InstanceVersionOpt enum +var AllowedInstanceVersionOptEnumValues = []InstanceVersionOpt{ + "2022", +} + +func (v *InstanceVersionOpt) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceVersionOpt(value) + for _, existing := range AllowedInstanceVersionOptEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InstanceVersionOpt", value) +} + +// NewInstanceVersionOptFromValue returns a pointer to a valid InstanceVersionOpt +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceVersionOptFromValue(v string) (*InstanceVersionOpt, error) { + ev := InstanceVersionOpt(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceVersionOpt: valid values are %v", v, AllowedInstanceVersionOptEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceVersionOpt) IsValid() bool { + for _, existing := range AllowedInstanceVersionOptEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to instance.version.opt value +func (v InstanceVersionOpt) Ptr() *InstanceVersionOpt { + return &v +} + +type NullableInstanceVersionOpt struct { + value *InstanceVersionOpt + isSet bool +} + +func (v NullableInstanceVersionOpt) Get() *InstanceVersionOpt { + return v.value +} + +func (v *NullableInstanceVersionOpt) Set(val *InstanceVersionOpt) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceVersionOpt) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceVersionOpt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceVersionOpt(val *InstanceVersionOpt) *NullableInstanceVersionOpt { + return &NullableInstanceVersionOpt{value: val, isSet: true} +} + +func (v NullableInstanceVersionOpt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceVersionOpt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3beta1api/model_list_backup.go b/services/sqlserverflex/v3beta1api/model_list_backup.go new file mode 100644 index 000000000..1c5a13a75 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_list_backup.go @@ -0,0 +1,303 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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 int64 `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 int64 `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 int64, name string, retainedUntil string, size int64, 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() int64 { + if o == nil { + var ret int64 + 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() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ListBackup) SetId(v int64) { + 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() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value +// and a boolean to check if the value has been set. +func (o *ListBackup) GetSizeOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value +func (o *ListBackup) SetSize(v int64) { + 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/sqlserverflex/v3beta1api/model_list_backup_response.go b/services/sqlserverflex/v3beta1api/model_list_backup_response.go new file mode 100644 index 000000000..71603f978 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_list_backup_response.go @@ -0,0 +1,186 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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 []ListBackupsResponse `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 []ListBackupsResponse, 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() []ListBackupsResponse { + if o == nil { + var ret []ListBackupsResponse + 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() ([]ListBackupsResponse, bool) { + if o == nil { + return nil, false + } + return o.Backups, true +} + +// SetBackups sets field value +func (o *ListBackupResponse) SetBackups(v []ListBackupsResponse) { + 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/sqlserverflex/v3beta1api/model_list_backups_response.go b/services/sqlserverflex/v3beta1api/model_list_backups_response.go new file mode 100644 index 000000000..455250f62 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_list_backups_response.go @@ -0,0 +1,187 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ListBackupsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListBackupsResponse{} + +// ListBackupsResponse struct for ListBackupsResponse +type ListBackupsResponse struct { + // List of the backups beloning to that database + Backups []ListBackup `json:"backups" validate:"required,dive"` + // Name of the database the backups belong to + DatabaseName string `json:"databaseName" validate:"required,databaseName"` +} + +type _ListBackupsResponse ListBackupsResponse + +// 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(backups []ListBackup, databaseName string) *ListBackupsResponse { + this := ListBackupsResponse{} + this.Backups = backups + this.DatabaseName = databaseName + 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 +} + +// GetBackups returns the Backups field value +func (o *ListBackupsResponse) 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 *ListBackupsResponse) GetBackupsOk() ([]ListBackup, bool) { + if o == nil { + return nil, false + } + return o.Backups, true +} + +// SetBackups sets field value +func (o *ListBackupsResponse) SetBackups(v []ListBackup) { + o.Backups = v +} + +// GetDatabaseName returns the DatabaseName field value +func (o *ListBackupsResponse) GetDatabaseName() string { + if o == nil { + var ret string + return ret + } + + return o.DatabaseName +} + +// GetDatabaseNameOk returns a tuple with the DatabaseName field value +// and a boolean to check if the value has been set. +func (o *ListBackupsResponse) GetDatabaseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DatabaseName, true +} + +// SetDatabaseName sets field value +func (o *ListBackupsResponse) SetDatabaseName(v string) { + o.DatabaseName = 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{}{} + toSerialize["backups"] = o.Backups + toSerialize["databaseName"] = o.DatabaseName + return toSerialize, nil +} + +func (o *ListBackupsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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", + "databaseName", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListBackupsResponse := _ListBackupsResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListBackupsResponse) + + if err != nil { + return err + } + + *o = ListBackupsResponse(varListBackupsResponse) + + return err +} + +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/sqlserverflex/v3beta1api/model_list_compatibility_response.go b/services/sqlserverflex/v3beta1api/model_list_compatibility_response.go new file mode 100644 index 000000000..a0c9d2749 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_list_compatibility_response.go @@ -0,0 +1,158 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ListCompatibilityResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListCompatibilityResponse{} + +// ListCompatibilityResponse struct for ListCompatibilityResponse +type ListCompatibilityResponse struct { + // List of compatibilities available for a d + Compatibilities []DatabaseGetcompatibility `json:"compatibilities"` +} + +type _ListCompatibilityResponse ListCompatibilityResponse + +// NewListCompatibilityResponse instantiates a new ListCompatibilityResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListCompatibilityResponse(compatibilities []DatabaseGetcompatibility) *ListCompatibilityResponse { + this := ListCompatibilityResponse{} + this.Compatibilities = compatibilities + return &this +} + +// NewListCompatibilityResponseWithDefaults instantiates a new ListCompatibilityResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListCompatibilityResponseWithDefaults() *ListCompatibilityResponse { + this := ListCompatibilityResponse{} + return &this +} + +// GetCompatibilities returns the Compatibilities field value +func (o *ListCompatibilityResponse) GetCompatibilities() []DatabaseGetcompatibility { + if o == nil { + var ret []DatabaseGetcompatibility + return ret + } + + return o.Compatibilities +} + +// GetCompatibilitiesOk returns a tuple with the Compatibilities field value +// and a boolean to check if the value has been set. +func (o *ListCompatibilityResponse) GetCompatibilitiesOk() ([]DatabaseGetcompatibility, bool) { + if o == nil { + return nil, false + } + return o.Compatibilities, true +} + +// SetCompatibilities sets field value +func (o *ListCompatibilityResponse) SetCompatibilities(v []DatabaseGetcompatibility) { + o.Compatibilities = v +} + +func (o ListCompatibilityResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListCompatibilityResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["compatibilities"] = o.Compatibilities + return toSerialize, nil +} + +func (o *ListCompatibilityResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "compatibilities", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListCompatibilityResponse := _ListCompatibilityResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListCompatibilityResponse) + + if err != nil { + return err + } + + *o = ListCompatibilityResponse(varListCompatibilityResponse) + + return err +} + +type NullableListCompatibilityResponse struct { + value *ListCompatibilityResponse + isSet bool +} + +func (v NullableListCompatibilityResponse) Get() *ListCompatibilityResponse { + return v.value +} + +func (v *NullableListCompatibilityResponse) Set(val *ListCompatibilityResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListCompatibilityResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListCompatibilityResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListCompatibilityResponse(val *ListCompatibilityResponse) *NullableListCompatibilityResponse { + return &NullableListCompatibilityResponse{value: val, isSet: true} +} + +func (v NullableListCompatibilityResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListCompatibilityResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3beta1api/model_list_current_running_restore_jobs.go b/services/sqlserverflex/v3beta1api/model_list_current_running_restore_jobs.go new file mode 100644 index 000000000..9d492bd9a --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_list_current_running_restore_jobs.go @@ -0,0 +1,158 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ListCurrentRunningRestoreJobs type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListCurrentRunningRestoreJobs{} + +// ListCurrentRunningRestoreJobs struct for ListCurrentRunningRestoreJobs +type ListCurrentRunningRestoreJobs struct { + // List of the currently running Restore jobs + RunningRestores []BackupRunningRestore `json:"runningRestores"` +} + +type _ListCurrentRunningRestoreJobs ListCurrentRunningRestoreJobs + +// NewListCurrentRunningRestoreJobs instantiates a new ListCurrentRunningRestoreJobs object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListCurrentRunningRestoreJobs(runningRestores []BackupRunningRestore) *ListCurrentRunningRestoreJobs { + this := ListCurrentRunningRestoreJobs{} + this.RunningRestores = runningRestores + return &this +} + +// NewListCurrentRunningRestoreJobsWithDefaults instantiates a new ListCurrentRunningRestoreJobs object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListCurrentRunningRestoreJobsWithDefaults() *ListCurrentRunningRestoreJobs { + this := ListCurrentRunningRestoreJobs{} + return &this +} + +// GetRunningRestores returns the RunningRestores field value +func (o *ListCurrentRunningRestoreJobs) GetRunningRestores() []BackupRunningRestore { + if o == nil { + var ret []BackupRunningRestore + return ret + } + + return o.RunningRestores +} + +// GetRunningRestoresOk returns a tuple with the RunningRestores field value +// and a boolean to check if the value has been set. +func (o *ListCurrentRunningRestoreJobs) GetRunningRestoresOk() ([]BackupRunningRestore, bool) { + if o == nil { + return nil, false + } + return o.RunningRestores, true +} + +// SetRunningRestores sets field value +func (o *ListCurrentRunningRestoreJobs) SetRunningRestores(v []BackupRunningRestore) { + o.RunningRestores = v +} + +func (o ListCurrentRunningRestoreJobs) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListCurrentRunningRestoreJobs) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["runningRestores"] = o.RunningRestores + return toSerialize, nil +} + +func (o *ListCurrentRunningRestoreJobs) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "runningRestores", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListCurrentRunningRestoreJobs := _ListCurrentRunningRestoreJobs{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListCurrentRunningRestoreJobs) + + if err != nil { + return err + } + + *o = ListCurrentRunningRestoreJobs(varListCurrentRunningRestoreJobs) + + return err +} + +type NullableListCurrentRunningRestoreJobs struct { + value *ListCurrentRunningRestoreJobs + isSet bool +} + +func (v NullableListCurrentRunningRestoreJobs) Get() *ListCurrentRunningRestoreJobs { + return v.value +} + +func (v *NullableListCurrentRunningRestoreJobs) Set(val *ListCurrentRunningRestoreJobs) { + v.value = val + v.isSet = true +} + +func (v NullableListCurrentRunningRestoreJobs) IsSet() bool { + return v.isSet +} + +func (v *NullableListCurrentRunningRestoreJobs) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListCurrentRunningRestoreJobs(val *ListCurrentRunningRestoreJobs) *NullableListCurrentRunningRestoreJobs { + return &NullableListCurrentRunningRestoreJobs{value: val, isSet: true} +} + +func (v NullableListCurrentRunningRestoreJobs) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListCurrentRunningRestoreJobs) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3beta1api/model_list_database.go b/services/sqlserverflex/v3beta1api/model_list_database.go new file mode 100644 index 000000000..1ec2de9cc --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_list_database.go @@ -0,0 +1,245 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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 date when the database was created in RFC3339 format. + Created string `json:"created"` + // The id of the database. + Id int64 `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(created string, id int64, name string, owner string) *ListDatabase { + this := ListDatabase{} + this.Created = created + 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 +} + +// GetCreated returns the Created field value +func (o *ListDatabase) GetCreated() string { + if o == nil { + var ret string + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *ListDatabase) GetCreatedOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *ListDatabase) SetCreated(v string) { + o.Created = v +} + +// GetId returns the Id field value +func (o *ListDatabase) GetId() int64 { + if o == nil { + var ret int64 + 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() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ListDatabase) SetId(v int64) { + 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["created"] = o.Created + 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{ + "created", + "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/sqlserverflex/v3beta1api/model_list_databases_response.go b/services/sqlserverflex/v3beta1api/model_list_databases_response.go new file mode 100644 index 000000000..621ae12a9 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_list_databases_response.go @@ -0,0 +1,186 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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/sqlserverflex/v3beta1api/model_list_flavors.go b/services/sqlserverflex/v3beta1api/model_list_flavors.go new file mode 100644 index 000000000..e8c8729e7 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_list_flavors.go @@ -0,0 +1,361 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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 int64 `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 int64 `json:"memory"` + // minimum storage which is required to order in Gigabyte. + MinGB int32 `json:"minGB"` + // defines the nodeType it can be either single or HA + 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 int64, description string, id string, maxGB int32, memory int64, 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() int64 { + if o == nil { + var ret int64 + 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() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Cpu, true +} + +// SetCpu sets field value +func (o *ListFlavors) SetCpu(v int64) { + 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() int64 { + if o == nil { + var ret int64 + 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() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Memory, true +} + +// SetMemory sets field value +func (o *ListFlavors) SetMemory(v int64) { + 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/sqlserverflex/v3beta1api/model_list_instance.go b/services/sqlserverflex/v3beta1api/model_list_instance.go new file mode 100644 index 000000000..9e5510e03 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_list_instance.go @@ -0,0 +1,244 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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/sqlserverflex/v3beta1api/model_list_instances_response.go b/services/sqlserverflex/v3beta1api/model_list_instances_response.go new file mode 100644 index 000000000..b20d8f159 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_list_instances_response.go @@ -0,0 +1,186 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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/sqlserverflex/v3beta1api/model_list_roles_response.go b/services/sqlserverflex/v3beta1api/model_list_roles_response.go new file mode 100644 index 000000000..fc2d88801 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_list_roles_response.go @@ -0,0 +1,158 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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 roles available for an 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/sqlserverflex/v3beta1api/model_list_user.go b/services/sqlserverflex/v3beta1api/model_list_user.go new file mode 100644 index 000000000..adebf2b89 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_list_user.go @@ -0,0 +1,216 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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 int64 `json:"id"` + // The current status of the user. + Status string `json:"status"` + // The name of the user. + Username string `json:"username"` +} + +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 int64, status string, username string) *ListUser { + this := ListUser{} + this.Id = id + this.Status = status + this.Username = username + 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() int64 { + if o == nil { + var ret int64 + 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() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ListUser) SetId(v int64) { + o.Id = 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 +} + +// GetUsername returns the Username field value +func (o *ListUser) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *ListUser) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *ListUser) SetUsername(v string) { + o.Username = 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["status"] = o.Status + toSerialize["username"] = o.Username + 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", + "status", + "username", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if 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/sqlserverflex/v3beta1api/model_list_user_response.go b/services/sqlserverflex/v3beta1api/model_list_user_response.go new file mode 100644 index 000000000..c55d3c485 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_list_user_response.go @@ -0,0 +1,186 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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/sqlserverflex/v3beta1api/model_pagination.go b/services/sqlserverflex/v3beta1api/model_pagination.go new file mode 100644 index 000000000..774a2503a --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_pagination.go @@ -0,0 +1,269 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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 int64 `json:"page" validate:"required"` + Size int64 `json:"size" validate:"required"` + Sort string `json:"sort" validate:"required"` + TotalPages int64 `json:"totalPages" validate:"required"` + TotalRows int64 `json:"totalRows" validate:"required"` +} + +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 int64, size int64, sort string, totalPages int64, totalRows int64) *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() int64 { + if o == nil { + var ret int64 + 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() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Page, true +} + +// SetPage sets field value +func (o *Pagination) SetPage(v int64) { + o.Page = v +} + +// GetSize returns the Size field value +func (o *Pagination) GetSize() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value +// and a boolean to check if the value has been set. +func (o *Pagination) GetSizeOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value +func (o *Pagination) SetSize(v int64) { + 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() int64 { + if o == nil { + var ret int64 + 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() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.TotalPages, true +} + +// SetTotalPages sets field value +func (o *Pagination) SetTotalPages(v int64) { + o.TotalPages = v +} + +// GetTotalRows returns the TotalRows field value +func (o *Pagination) GetTotalRows() int64 { + if o == nil { + var ret int64 + 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() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.TotalRows, true +} + +// SetTotalRows sets field value +func (o *Pagination) SetTotalRows(v int64) { + 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/sqlserverflex/v3beta1api/model_protect_instance_request_payload.go b/services/sqlserverflex/v3beta1api/model_protect_instance_request_payload.go new file mode 100644 index 000000000..258a3f429 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_protect_instance_request_payload.go @@ -0,0 +1,158 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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/sqlserverflex/v3beta1api/model_protect_instance_response.go b/services/sqlserverflex/v3beta1api/model_protect_instance_response.go new file mode 100644 index 000000000..b64ad78e1 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_protect_instance_response.go @@ -0,0 +1,158 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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/sqlserverflex/v3beta1api/model_replicas.go b/services/sqlserverflex/v3beta1api/model_replicas.go new file mode 100644 index 000000000..d8c4a78e5 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_replicas.go @@ -0,0 +1,111 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +import ( + "encoding/json" + "fmt" +) + +// Replicas How many replicas the instance should have. +type Replicas int32 + +// 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 int32 + 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 int32) (*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/sqlserverflex/v3beta1api/model_replicas_opt.go b/services/sqlserverflex/v3beta1api/model_replicas_opt.go new file mode 100644 index 000000000..07a28e97a --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_replicas_opt.go @@ -0,0 +1,111 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +import ( + "encoding/json" + "fmt" +) + +// ReplicasOpt How many replicas the instance should have. +type ReplicasOpt int32 + +// 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 int32 + 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 int32) (*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/sqlserverflex/v3beta1api/model_reset_user_response.go b/services/sqlserverflex/v3beta1api/model_reset_user_response.go new file mode 100644 index 000000000..1aa90214c --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_reset_user_response.go @@ -0,0 +1,245 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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 password for the user. + Password string `json:"password"` + // The current status of the user. + Status string `json:"status"` + // The connection string for the user to the instance. + Uri string `json:"uri"` + // The name of the user. + Username string `json:"username"` +} + +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(password string, status string, uri string, username string) *ResetUserResponse { + this := ResetUserResponse{} + this.Password = password + this.Status = status + this.Uri = uri + this.Username = username + 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 +} + +// 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 +} + +// GetUri returns the Uri field value +func (o *ResetUserResponse) GetUri() string { + if o == nil { + var ret string + return ret + } + + return o.Uri +} + +// GetUriOk returns a tuple with the Uri field value +// and a boolean to check if the value has been set. +func (o *ResetUserResponse) GetUriOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Uri, true +} + +// SetUri sets field value +func (o *ResetUserResponse) SetUri(v string) { + o.Uri = v +} + +// GetUsername returns the Username field value +func (o *ResetUserResponse) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *ResetUserResponse) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *ResetUserResponse) SetUsername(v string) { + o.Username = 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["password"] = o.Password + toSerialize["status"] = o.Status + toSerialize["uri"] = o.Uri + toSerialize["username"] = o.Username + 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{ + "password", + "status", + "uri", + "username", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if 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/sqlserverflex/v3beta1api/model_restore_database_from_backup_payload.go b/services/sqlserverflex/v3beta1api/model_restore_database_from_backup_payload.go new file mode 100644 index 000000000..d828ec8a6 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_restore_database_from_backup_payload.go @@ -0,0 +1,186 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the RestoreDatabaseFromBackupPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RestoreDatabaseFromBackupPayload{} + +// RestoreDatabaseFromBackupPayload Request to restore a database. +type RestoreDatabaseFromBackupPayload struct { + // The name of the database on the instance to be restore. + DatabaseName string `json:"database_name"` + Source RestoreDatabaseFromBackupPayloadSource `json:"source"` +} + +type _RestoreDatabaseFromBackupPayload RestoreDatabaseFromBackupPayload + +// NewRestoreDatabaseFromBackupPayload instantiates a new RestoreDatabaseFromBackupPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRestoreDatabaseFromBackupPayload(databaseName string, source RestoreDatabaseFromBackupPayloadSource) *RestoreDatabaseFromBackupPayload { + this := RestoreDatabaseFromBackupPayload{} + this.DatabaseName = databaseName + this.Source = source + return &this +} + +// NewRestoreDatabaseFromBackupPayloadWithDefaults instantiates a new RestoreDatabaseFromBackupPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRestoreDatabaseFromBackupPayloadWithDefaults() *RestoreDatabaseFromBackupPayload { + this := RestoreDatabaseFromBackupPayload{} + return &this +} + +// GetDatabaseName returns the DatabaseName field value +func (o *RestoreDatabaseFromBackupPayload) GetDatabaseName() string { + if o == nil { + var ret string + return ret + } + + return o.DatabaseName +} + +// GetDatabaseNameOk returns a tuple with the DatabaseName field value +// and a boolean to check if the value has been set. +func (o *RestoreDatabaseFromBackupPayload) GetDatabaseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DatabaseName, true +} + +// SetDatabaseName sets field value +func (o *RestoreDatabaseFromBackupPayload) SetDatabaseName(v string) { + o.DatabaseName = v +} + +// GetSource returns the Source field value +func (o *RestoreDatabaseFromBackupPayload) GetSource() RestoreDatabaseFromBackupPayloadSource { + if o == nil { + var ret RestoreDatabaseFromBackupPayloadSource + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *RestoreDatabaseFromBackupPayload) GetSourceOk() (*RestoreDatabaseFromBackupPayloadSource, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *RestoreDatabaseFromBackupPayload) SetSource(v RestoreDatabaseFromBackupPayloadSource) { + o.Source = v +} + +func (o RestoreDatabaseFromBackupPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RestoreDatabaseFromBackupPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["database_name"] = o.DatabaseName + toSerialize["source"] = o.Source + return toSerialize, nil +} + +func (o *RestoreDatabaseFromBackupPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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_name", + "source", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRestoreDatabaseFromBackupPayload := _RestoreDatabaseFromBackupPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRestoreDatabaseFromBackupPayload) + + if err != nil { + return err + } + + *o = RestoreDatabaseFromBackupPayload(varRestoreDatabaseFromBackupPayload) + + return err +} + +type NullableRestoreDatabaseFromBackupPayload struct { + value *RestoreDatabaseFromBackupPayload + isSet bool +} + +func (v NullableRestoreDatabaseFromBackupPayload) Get() *RestoreDatabaseFromBackupPayload { + return v.value +} + +func (v *NullableRestoreDatabaseFromBackupPayload) Set(val *RestoreDatabaseFromBackupPayload) { + v.value = val + v.isSet = true +} + +func (v NullableRestoreDatabaseFromBackupPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableRestoreDatabaseFromBackupPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRestoreDatabaseFromBackupPayload(val *RestoreDatabaseFromBackupPayload) *NullableRestoreDatabaseFromBackupPayload { + return &NullableRestoreDatabaseFromBackupPayload{value: val, isSet: true} +} + +func (v NullableRestoreDatabaseFromBackupPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRestoreDatabaseFromBackupPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3beta1api/model_restore_database_from_backup_payload_source.go b/services/sqlserverflex/v3beta1api/model_restore_database_from_backup_payload_source.go new file mode 100644 index 000000000..f3d491757 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_restore_database_from_backup_payload_source.go @@ -0,0 +1,154 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +import ( + "encoding/json" + "fmt" +) + +// RestoreDatabaseFromBackupPayloadSource - The source of the restore. +type RestoreDatabaseFromBackupPayloadSource struct { + SourceBackup *SourceBackup + SourceExternalS3 *SourceExternalS3 +} + +// SourceBackupAsRestoreDatabaseFromBackupPayloadSource is a convenience function that returns SourceBackup wrapped in RestoreDatabaseFromBackupPayloadSource +func SourceBackupAsRestoreDatabaseFromBackupPayloadSource(v *SourceBackup) RestoreDatabaseFromBackupPayloadSource { + return RestoreDatabaseFromBackupPayloadSource{ + SourceBackup: v, + } +} + +// SourceExternalS3AsRestoreDatabaseFromBackupPayloadSource is a convenience function that returns SourceExternalS3 wrapped in RestoreDatabaseFromBackupPayloadSource +func SourceExternalS3AsRestoreDatabaseFromBackupPayloadSource(v *SourceExternalS3) RestoreDatabaseFromBackupPayloadSource { + return RestoreDatabaseFromBackupPayloadSource{ + SourceExternalS3: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *RestoreDatabaseFromBackupPayloadSource) UnmarshalJSON(data []byte) error { + var err error + // use discriminator value to speed up the lookup + var jsonDict map[string]interface{} + err = newStrictDecoder(data).Decode(&jsonDict) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") + } + + // check if the discriminator value is 'BACKUP' + if jsonDict["type"] == "BACKUP" { + // try to unmarshal JSON data into SourceBackup + err = json.Unmarshal(data, &dst.SourceBackup) + if err == nil { + return nil // data stored in dst.SourceBackup, return on the first match + } else { + dst.SourceBackup = nil + return fmt.Errorf("failed to unmarshal RestoreDatabaseFromBackupPayloadSource as SourceBackup: %s", err.Error()) + } + } + + // check if the discriminator value is 'EXTERNAL_S3' + if jsonDict["type"] == "EXTERNAL_S3" { + // try to unmarshal JSON data into SourceExternalS3 + err = json.Unmarshal(data, &dst.SourceExternalS3) + if err == nil { + return nil // data stored in dst.SourceExternalS3, return on the first match + } else { + dst.SourceExternalS3 = nil + return fmt.Errorf("failed to unmarshal RestoreDatabaseFromBackupPayloadSource as SourceExternalS3: %s", err.Error()) + } + } + + return nil +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src RestoreDatabaseFromBackupPayloadSource) MarshalJSON() ([]byte, error) { + if src.SourceBackup != nil { + return json.Marshal(&src.SourceBackup) + } + + if src.SourceExternalS3 != nil { + return json.Marshal(&src.SourceExternalS3) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *RestoreDatabaseFromBackupPayloadSource) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.SourceBackup != nil { + return obj.SourceBackup + } + + if obj.SourceExternalS3 != nil { + return obj.SourceExternalS3 + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj RestoreDatabaseFromBackupPayloadSource) GetActualInstanceValue() interface{} { + if obj.SourceBackup != nil { + return *obj.SourceBackup + } + + if obj.SourceExternalS3 != nil { + return *obj.SourceExternalS3 + } + + // all schemas are nil + return nil +} + +type NullableRestoreDatabaseFromBackupPayloadSource struct { + value *RestoreDatabaseFromBackupPayloadSource + isSet bool +} + +func (v NullableRestoreDatabaseFromBackupPayloadSource) Get() *RestoreDatabaseFromBackupPayloadSource { + return v.value +} + +func (v *NullableRestoreDatabaseFromBackupPayloadSource) Set(val *RestoreDatabaseFromBackupPayloadSource) { + v.value = val + v.isSet = true +} + +func (v NullableRestoreDatabaseFromBackupPayloadSource) IsSet() bool { + return v.isSet +} + +func (v *NullableRestoreDatabaseFromBackupPayloadSource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRestoreDatabaseFromBackupPayloadSource(val *RestoreDatabaseFromBackupPayloadSource) *NullableRestoreDatabaseFromBackupPayloadSource { + return &NullableRestoreDatabaseFromBackupPayloadSource{value: val, isSet: true} +} + +func (v NullableRestoreDatabaseFromBackupPayloadSource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRestoreDatabaseFromBackupPayloadSource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3beta1api/model_s3file_info.go b/services/sqlserverflex/v3beta1api/model_s3file_info.go new file mode 100644 index 000000000..3261d48b6 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_s3file_info.go @@ -0,0 +1,163 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +import ( + "encoding/json" +) + +// checks if the S3fileInfo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &S3fileInfo{} + +// S3fileInfo struct for S3fileInfo +type S3fileInfo struct { + // The sequence number of the file + FileNumber *int32 `json:"file_number,omitempty"` + // The path to the file on the S3 bucket + FilePath *string `json:"file_path,omitempty"` +} + +// NewS3fileInfo instantiates a new S3fileInfo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewS3fileInfo() *S3fileInfo { + this := S3fileInfo{} + return &this +} + +// NewS3fileInfoWithDefaults instantiates a new S3fileInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewS3fileInfoWithDefaults() *S3fileInfo { + this := S3fileInfo{} + return &this +} + +// GetFileNumber returns the FileNumber field value if set, zero value otherwise. +func (o *S3fileInfo) GetFileNumber() int32 { + if o == nil || IsNil(o.FileNumber) { + var ret int32 + return ret + } + return *o.FileNumber +} + +// GetFileNumberOk returns a tuple with the FileNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *S3fileInfo) GetFileNumberOk() (*int32, bool) { + if o == nil || IsNil(o.FileNumber) { + return nil, false + } + return o.FileNumber, true +} + +// HasFileNumber returns a boolean if a field has been set. +func (o *S3fileInfo) HasFileNumber() bool { + if o != nil && !IsNil(o.FileNumber) { + return true + } + + return false +} + +// SetFileNumber gets a reference to the given int32 and assigns it to the FileNumber field. +func (o *S3fileInfo) SetFileNumber(v int32) { + o.FileNumber = &v +} + +// GetFilePath returns the FilePath field value if set, zero value otherwise. +func (o *S3fileInfo) GetFilePath() string { + if o == nil || IsNil(o.FilePath) { + var ret string + return ret + } + return *o.FilePath +} + +// GetFilePathOk returns a tuple with the FilePath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *S3fileInfo) GetFilePathOk() (*string, bool) { + if o == nil || IsNil(o.FilePath) { + return nil, false + } + return o.FilePath, true +} + +// HasFilePath returns a boolean if a field has been set. +func (o *S3fileInfo) HasFilePath() bool { + if o != nil && !IsNil(o.FilePath) { + return true + } + + return false +} + +// SetFilePath gets a reference to the given string and assigns it to the FilePath field. +func (o *S3fileInfo) SetFilePath(v string) { + o.FilePath = &v +} + +func (o S3fileInfo) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o S3fileInfo) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.FileNumber) { + toSerialize["file_number"] = o.FileNumber + } + if !IsNil(o.FilePath) { + toSerialize["file_path"] = o.FilePath + } + return toSerialize, nil +} + +type NullableS3fileInfo struct { + value *S3fileInfo + isSet bool +} + +func (v NullableS3fileInfo) Get() *S3fileInfo { + return v.value +} + +func (v *NullableS3fileInfo) Set(val *S3fileInfo) { + v.value = val + v.isSet = true +} + +func (v NullableS3fileInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableS3fileInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableS3fileInfo(val *S3fileInfo) *NullableS3fileInfo { + return &NullableS3fileInfo{value: val, isSet: true} +} + +func (v NullableS3fileInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableS3fileInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3beta1api/model_source_backup.go b/services/sqlserverflex/v3beta1api/model_source_backup.go new file mode 100644 index 000000000..8945d39f7 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_source_backup.go @@ -0,0 +1,157 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the SourceBackup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SourceBackup{} + +// SourceBackup Restore from an existing managed backup. +type SourceBackup struct { + Type string `json:"type"` +} + +type _SourceBackup SourceBackup + +// NewSourceBackup instantiates a new SourceBackup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSourceBackup(types string) *SourceBackup { + this := SourceBackup{} + this.Type = types + return &this +} + +// NewSourceBackupWithDefaults instantiates a new SourceBackup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSourceBackupWithDefaults() *SourceBackup { + this := SourceBackup{} + return &this +} + +// GetType returns the Type field value +func (o *SourceBackup) 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 *SourceBackup) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *SourceBackup) SetType(v string) { + o.Type = v +} + +func (o SourceBackup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SourceBackup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *SourceBackup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSourceBackup := _SourceBackup{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varSourceBackup) + + if err != nil { + return err + } + + *o = SourceBackup(varSourceBackup) + + return err +} + +type NullableSourceBackup struct { + value *SourceBackup + isSet bool +} + +func (v NullableSourceBackup) Get() *SourceBackup { + return v.value +} + +func (v *NullableSourceBackup) Set(val *SourceBackup) { + v.value = val + v.isSet = true +} + +func (v NullableSourceBackup) IsSet() bool { + return v.isSet +} + +func (v *NullableSourceBackup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSourceBackup(val *SourceBackup) *NullableSourceBackup { + return &NullableSourceBackup{value: val, isSet: true} +} + +func (v NullableSourceBackup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSourceBackup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3beta1api/model_source_external_s3.go b/services/sqlserverflex/v3beta1api/model_source_external_s3.go new file mode 100644 index 000000000..6e3ad9890 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_source_external_s3.go @@ -0,0 +1,251 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the SourceExternalS3 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SourceExternalS3{} + +// SourceExternalS3 Restore from an external S3 backup file. +type SourceExternalS3 struct { + // The owner of the database. + DatabaseOwner string `json:"database_owner"` + // Logging guid to have a complete activity log over all sub stored procedures. + LoggingGuid *string `json:"logging_guid,omitempty"` + S3Details ExternalS3 `json:"s3_details"` + Type string `json:"type"` +} + +type _SourceExternalS3 SourceExternalS3 + +// NewSourceExternalS3 instantiates a new SourceExternalS3 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSourceExternalS3(databaseOwner string, s3Details ExternalS3, types string) *SourceExternalS3 { + this := SourceExternalS3{} + this.DatabaseOwner = databaseOwner + this.S3Details = s3Details + this.Type = types + return &this +} + +// NewSourceExternalS3WithDefaults instantiates a new SourceExternalS3 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSourceExternalS3WithDefaults() *SourceExternalS3 { + this := SourceExternalS3{} + return &this +} + +// GetDatabaseOwner returns the DatabaseOwner field value +func (o *SourceExternalS3) GetDatabaseOwner() string { + if o == nil { + var ret string + return ret + } + + return o.DatabaseOwner +} + +// GetDatabaseOwnerOk returns a tuple with the DatabaseOwner field value +// and a boolean to check if the value has been set. +func (o *SourceExternalS3) GetDatabaseOwnerOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DatabaseOwner, true +} + +// SetDatabaseOwner sets field value +func (o *SourceExternalS3) SetDatabaseOwner(v string) { + o.DatabaseOwner = v +} + +// GetLoggingGuid returns the LoggingGuid field value if set, zero value otherwise. +func (o *SourceExternalS3) GetLoggingGuid() string { + if o == nil || IsNil(o.LoggingGuid) { + var ret string + return ret + } + return *o.LoggingGuid +} + +// GetLoggingGuidOk returns a tuple with the LoggingGuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SourceExternalS3) GetLoggingGuidOk() (*string, bool) { + if o == nil || IsNil(o.LoggingGuid) { + return nil, false + } + return o.LoggingGuid, true +} + +// HasLoggingGuid returns a boolean if a field has been set. +func (o *SourceExternalS3) HasLoggingGuid() bool { + if o != nil && !IsNil(o.LoggingGuid) { + return true + } + + return false +} + +// SetLoggingGuid gets a reference to the given string and assigns it to the LoggingGuid field. +func (o *SourceExternalS3) SetLoggingGuid(v string) { + o.LoggingGuid = &v +} + +// GetS3Details returns the S3Details field value +func (o *SourceExternalS3) GetS3Details() ExternalS3 { + if o == nil { + var ret ExternalS3 + return ret + } + + return o.S3Details +} + +// GetS3DetailsOk returns a tuple with the S3Details field value +// and a boolean to check if the value has been set. +func (o *SourceExternalS3) GetS3DetailsOk() (*ExternalS3, bool) { + if o == nil { + return nil, false + } + return &o.S3Details, true +} + +// SetS3Details sets field value +func (o *SourceExternalS3) SetS3Details(v ExternalS3) { + o.S3Details = v +} + +// GetType returns the Type field value +func (o *SourceExternalS3) 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 *SourceExternalS3) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *SourceExternalS3) SetType(v string) { + o.Type = v +} + +func (o SourceExternalS3) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SourceExternalS3) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["database_owner"] = o.DatabaseOwner + if !IsNil(o.LoggingGuid) { + toSerialize["logging_guid"] = o.LoggingGuid + } + toSerialize["s3_details"] = o.S3Details + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *SourceExternalS3) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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_owner", + "s3_details", + "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) + } + } + + varSourceExternalS3 := _SourceExternalS3{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varSourceExternalS3) + + if err != nil { + return err + } + + *o = SourceExternalS3(varSourceExternalS3) + + return err +} + +type NullableSourceExternalS3 struct { + value *SourceExternalS3 + isSet bool +} + +func (v NullableSourceExternalS3) Get() *SourceExternalS3 { + return v.value +} + +func (v *NullableSourceExternalS3) Set(val *SourceExternalS3) { + v.value = val + v.isSet = true +} + +func (v NullableSourceExternalS3) IsSet() bool { + return v.isSet +} + +func (v *NullableSourceExternalS3) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSourceExternalS3(val *SourceExternalS3) *NullableSourceExternalS3 { + return &NullableSourceExternalS3{value: val, isSet: true} +} + +func (v NullableSourceExternalS3) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSourceExternalS3) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3beta1api/model_status.go b/services/sqlserverflex/v3beta1api/model_status.go new file mode 100644 index 000000000..0a18968a4 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_status.go @@ -0,0 +1,119 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +import ( + "encoding/json" + "fmt" +) + +// Status the model 'Status' +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/sqlserverflex/v3beta1api/model_storage.go b/services/sqlserverflex/v3beta1api/model_storage.go new file mode 100644 index 000000000..9ac3d2e08 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_storage.go @@ -0,0 +1,163 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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. + Class *string `json:"class,omitempty"` + // The storage size in Gigabytes. + 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/sqlserverflex/v3beta1api/model_storage_create.go b/services/sqlserverflex/v3beta1api/model_storage_create.go new file mode 100644 index 000000000..fb53c11fe --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_storage_create.go @@ -0,0 +1,187 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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. + Class string `json:"class"` + // The storage size in Gigabytes. + Size int64 `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(class string, size int64) *StorageCreate { + this := StorageCreate{} + this.Class = class + 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 +} + +// GetClass returns the Class field value +func (o *StorageCreate) 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 *StorageCreate) GetClassOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Class, true +} + +// SetClass sets field value +func (o *StorageCreate) SetClass(v string) { + o.Class = v +} + +// GetSize returns the Size field value +func (o *StorageCreate) GetSize() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value +// and a boolean to check if the value has been set. +func (o *StorageCreate) GetSizeOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value +func (o *StorageCreate) SetSize(v int64) { + 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["class"] = o.Class + 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{ + "class", + "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/sqlserverflex/v3beta1api/model_storage_update.go b/services/sqlserverflex/v3beta1api/model_storage_update.go new file mode 100644 index 000000000..157a552d7 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_storage_update.go @@ -0,0 +1,126 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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 *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 +} + +// 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.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/sqlserverflex/v3beta1api/model_trigger_restore_request_payload.go b/services/sqlserverflex/v3beta1api/model_trigger_restore_request_payload.go new file mode 100644 index 000000000..1a161322c --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_trigger_restore_request_payload.go @@ -0,0 +1,187 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the TriggerRestoreRequestPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TriggerRestoreRequestPayload{} + +// TriggerRestoreRequestPayload struct for TriggerRestoreRequestPayload +type TriggerRestoreRequestPayload struct { + // The name of the database. + Name string `json:"name"` + // the time for the restore it will be calculated between first backup and last backup + RestoreDateTime string `json:"restoreDateTime"` +} + +type _TriggerRestoreRequestPayload TriggerRestoreRequestPayload + +// NewTriggerRestoreRequestPayload instantiates a new TriggerRestoreRequestPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTriggerRestoreRequestPayload(name string, restoreDateTime string) *TriggerRestoreRequestPayload { + this := TriggerRestoreRequestPayload{} + this.Name = name + this.RestoreDateTime = restoreDateTime + return &this +} + +// NewTriggerRestoreRequestPayloadWithDefaults instantiates a new TriggerRestoreRequestPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTriggerRestoreRequestPayloadWithDefaults() *TriggerRestoreRequestPayload { + this := TriggerRestoreRequestPayload{} + return &this +} + +// GetName returns the Name field value +func (o *TriggerRestoreRequestPayload) 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 *TriggerRestoreRequestPayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *TriggerRestoreRequestPayload) SetName(v string) { + o.Name = v +} + +// GetRestoreDateTime returns the RestoreDateTime field value +func (o *TriggerRestoreRequestPayload) GetRestoreDateTime() string { + if o == nil { + var ret string + return ret + } + + return o.RestoreDateTime +} + +// GetRestoreDateTimeOk returns a tuple with the RestoreDateTime field value +// and a boolean to check if the value has been set. +func (o *TriggerRestoreRequestPayload) GetRestoreDateTimeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RestoreDateTime, true +} + +// SetRestoreDateTime sets field value +func (o *TriggerRestoreRequestPayload) SetRestoreDateTime(v string) { + o.RestoreDateTime = v +} + +func (o TriggerRestoreRequestPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TriggerRestoreRequestPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["restoreDateTime"] = o.RestoreDateTime + return toSerialize, nil +} + +func (o *TriggerRestoreRequestPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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", + "restoreDateTime", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTriggerRestoreRequestPayload := _TriggerRestoreRequestPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varTriggerRestoreRequestPayload) + + if err != nil { + return err + } + + *o = TriggerRestoreRequestPayload(varTriggerRestoreRequestPayload) + + return err +} + +type NullableTriggerRestoreRequestPayload struct { + value *TriggerRestoreRequestPayload + isSet bool +} + +func (v NullableTriggerRestoreRequestPayload) Get() *TriggerRestoreRequestPayload { + return v.value +} + +func (v *NullableTriggerRestoreRequestPayload) Set(val *TriggerRestoreRequestPayload) { + v.value = val + v.isSet = true +} + +func (v NullableTriggerRestoreRequestPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableTriggerRestoreRequestPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTriggerRestoreRequestPayload(val *TriggerRestoreRequestPayload) *NullableTriggerRestoreRequestPayload { + return &NullableTriggerRestoreRequestPayload{value: val, isSet: true} +} + +func (v NullableTriggerRestoreRequestPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTriggerRestoreRequestPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3beta1api/model_update_instance_partially_request_payload.go b/services/sqlserverflex/v3beta1api/model_update_instance_partially_request_payload.go new file mode 100644 index 000000000..77a6d24f0 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_update_instance_partially_request_payload.go @@ -0,0 +1,380 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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 on what time and how often the database backup will be created. 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 *UpdateInstancePartiallyRequestPayloadNetwork `json:"network,omitempty"` + Replicas *ReplicasOpt `json:"replicas,omitempty"` + RetentionDays *int32 `json:"retentionDays,omitempty"` + Storage *StorageUpdate `json:"storage,omitempty"` + Version *InstanceVersionOpt `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() UpdateInstancePartiallyRequestPayloadNetwork { + if o == nil || IsNil(o.Network) { + var ret UpdateInstancePartiallyRequestPayloadNetwork + 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() (*UpdateInstancePartiallyRequestPayloadNetwork, 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 UpdateInstancePartiallyRequestPayloadNetwork and assigns it to the Network field. +func (o *UpdateInstancePartiallyRequestPayload) SetNetwork(v UpdateInstancePartiallyRequestPayloadNetwork) { + 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() InstanceVersionOpt { + if o == nil || IsNil(o.Version) { + var ret InstanceVersionOpt + 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() (*InstanceVersionOpt, 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 InstanceVersionOpt and assigns it to the Version field. +func (o *UpdateInstancePartiallyRequestPayload) SetVersion(v InstanceVersionOpt) { + 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/sqlserverflex/v3beta1api/model_update_instance_partially_request_payload_network.go b/services/sqlserverflex/v3beta1api/model_update_instance_partially_request_payload_network.go new file mode 100644 index 000000000..b577ad36c --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_update_instance_partially_request_payload_network.go @@ -0,0 +1,126 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +import ( + "encoding/json" +) + +// checks if the UpdateInstancePartiallyRequestPayloadNetwork type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateInstancePartiallyRequestPayloadNetwork{} + +// UpdateInstancePartiallyRequestPayloadNetwork the network configuration of the instance. +type UpdateInstancePartiallyRequestPayloadNetwork struct { + // List of IPV4 cidr. + Acl []string `json:"acl,omitempty"` +} + +// NewUpdateInstancePartiallyRequestPayloadNetwork instantiates a new UpdateInstancePartiallyRequestPayloadNetwork object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateInstancePartiallyRequestPayloadNetwork() *UpdateInstancePartiallyRequestPayloadNetwork { + this := UpdateInstancePartiallyRequestPayloadNetwork{} + return &this +} + +// NewUpdateInstancePartiallyRequestPayloadNetworkWithDefaults instantiates a new UpdateInstancePartiallyRequestPayloadNetwork object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateInstancePartiallyRequestPayloadNetworkWithDefaults() *UpdateInstancePartiallyRequestPayloadNetwork { + this := UpdateInstancePartiallyRequestPayloadNetwork{} + return &this +} + +// GetAcl returns the Acl field value if set, zero value otherwise. +func (o *UpdateInstancePartiallyRequestPayloadNetwork) 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 *UpdateInstancePartiallyRequestPayloadNetwork) 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 *UpdateInstancePartiallyRequestPayloadNetwork) 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 *UpdateInstancePartiallyRequestPayloadNetwork) SetAcl(v []string) { + o.Acl = v +} + +func (o UpdateInstancePartiallyRequestPayloadNetwork) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateInstancePartiallyRequestPayloadNetwork) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Acl) { + toSerialize["acl"] = o.Acl + } + return toSerialize, nil +} + +type NullableUpdateInstancePartiallyRequestPayloadNetwork struct { + value *UpdateInstancePartiallyRequestPayloadNetwork + isSet bool +} + +func (v NullableUpdateInstancePartiallyRequestPayloadNetwork) Get() *UpdateInstancePartiallyRequestPayloadNetwork { + return v.value +} + +func (v *NullableUpdateInstancePartiallyRequestPayloadNetwork) Set(val *UpdateInstancePartiallyRequestPayloadNetwork) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateInstancePartiallyRequestPayloadNetwork) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateInstancePartiallyRequestPayloadNetwork) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateInstancePartiallyRequestPayloadNetwork(val *UpdateInstancePartiallyRequestPayloadNetwork) *NullableUpdateInstancePartiallyRequestPayloadNetwork { + return &NullableUpdateInstancePartiallyRequestPayloadNetwork{value: val, isSet: true} +} + +func (v NullableUpdateInstancePartiallyRequestPayloadNetwork) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateInstancePartiallyRequestPayloadNetwork) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3beta1api/model_update_instance_request_payload.go b/services/sqlserverflex/v3beta1api/model_update_instance_request_payload.go new file mode 100644 index 000000000..5630a02e3 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_update_instance_request_payload.go @@ -0,0 +1,357 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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 on what time and how often the database backup will be created. 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 UpdateInstanceRequestPayloadNetwork `json:"network"` + Replicas Replicas `json:"replicas"` + // The days for how long the backup files should be stored before cleaned up. 30 to 365 + RetentionDays int32 `json:"retentionDays"` + Storage StorageUpdate `json:"storage"` + Version InstanceVersion `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 UpdateInstanceRequestPayloadNetwork, replicas Replicas, retentionDays int32, storage StorageUpdate, version InstanceVersion) *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() UpdateInstanceRequestPayloadNetwork { + if o == nil { + var ret UpdateInstanceRequestPayloadNetwork + 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() (*UpdateInstanceRequestPayloadNetwork, bool) { + if o == nil { + return nil, false + } + return &o.Network, true +} + +// SetNetwork sets field value +func (o *UpdateInstanceRequestPayload) SetNetwork(v UpdateInstanceRequestPayloadNetwork) { + 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() InstanceVersion { + if o == nil { + var ret InstanceVersion + 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() (*InstanceVersion, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *UpdateInstanceRequestPayload) SetVersion(v InstanceVersion) { + 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/sqlserverflex/v3beta1api/model_update_instance_request_payload_network.go b/services/sqlserverflex/v3beta1api/model_update_instance_request_payload_network.go new file mode 100644 index 000000000..fce63fc20 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_update_instance_request_payload_network.go @@ -0,0 +1,158 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the UpdateInstanceRequestPayloadNetwork type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateInstanceRequestPayloadNetwork{} + +// UpdateInstanceRequestPayloadNetwork the network configuration of the instance. +type UpdateInstanceRequestPayloadNetwork struct { + // List of IPV4 cidr. + Acl []string `json:"acl"` +} + +type _UpdateInstanceRequestPayloadNetwork UpdateInstanceRequestPayloadNetwork + +// NewUpdateInstanceRequestPayloadNetwork instantiates a new UpdateInstanceRequestPayloadNetwork object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateInstanceRequestPayloadNetwork(acl []string) *UpdateInstanceRequestPayloadNetwork { + this := UpdateInstanceRequestPayloadNetwork{} + this.Acl = acl + return &this +} + +// NewUpdateInstanceRequestPayloadNetworkWithDefaults instantiates a new UpdateInstanceRequestPayloadNetwork object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateInstanceRequestPayloadNetworkWithDefaults() *UpdateInstanceRequestPayloadNetwork { + this := UpdateInstanceRequestPayloadNetwork{} + return &this +} + +// GetAcl returns the Acl field value +func (o *UpdateInstanceRequestPayloadNetwork) 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 *UpdateInstanceRequestPayloadNetwork) GetAclOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Acl, true +} + +// SetAcl sets field value +func (o *UpdateInstanceRequestPayloadNetwork) SetAcl(v []string) { + o.Acl = v +} + +func (o UpdateInstanceRequestPayloadNetwork) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateInstanceRequestPayloadNetwork) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["acl"] = o.Acl + return toSerialize, nil +} + +func (o *UpdateInstanceRequestPayloadNetwork) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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) + } + } + + varUpdateInstanceRequestPayloadNetwork := _UpdateInstanceRequestPayloadNetwork{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varUpdateInstanceRequestPayloadNetwork) + + if err != nil { + return err + } + + *o = UpdateInstanceRequestPayloadNetwork(varUpdateInstanceRequestPayloadNetwork) + + return err +} + +type NullableUpdateInstanceRequestPayloadNetwork struct { + value *UpdateInstanceRequestPayloadNetwork + isSet bool +} + +func (v NullableUpdateInstanceRequestPayloadNetwork) Get() *UpdateInstanceRequestPayloadNetwork { + return v.value +} + +func (v *NullableUpdateInstanceRequestPayloadNetwork) Set(val *UpdateInstanceRequestPayloadNetwork) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateInstanceRequestPayloadNetwork) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateInstanceRequestPayloadNetwork) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateInstanceRequestPayloadNetwork(val *UpdateInstanceRequestPayloadNetwork) *NullableUpdateInstanceRequestPayloadNetwork { + return &NullableUpdateInstanceRequestPayloadNetwork{value: val, isSet: true} +} + +func (v NullableUpdateInstanceRequestPayloadNetwork) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateInstanceRequestPayloadNetwork) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3beta1api/model_user_sort.go b/services/sqlserverflex/v3beta1api/model_user_sort.go new file mode 100644 index 000000000..69a2b3ee8 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_user_sort.go @@ -0,0 +1,123 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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_INDEX_DESC UserSort = "index.desc" + USERSORT_INDEX_ASC UserSort = "index.asc" + 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", + "index.desc", + "index.asc", + "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/sqlserverflex/v3beta1api/model_validation_error.go b/services/sqlserverflex/v3beta1api/model_validation_error.go new file mode 100644 index 000000000..5375f2d57 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_validation_error.go @@ -0,0 +1,187 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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/sqlserverflex/v3beta1api/model_validation_error_validation_inner.go b/services/sqlserverflex/v3beta1api/model_validation_error_validation_inner.go new file mode 100644 index 000000000..f78076c29 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_validation_error_validation_inner.go @@ -0,0 +1,185 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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/sqlserverflex/v3beta1api/model_version.go b/services/sqlserverflex/v3beta1api/model_version.go new file mode 100644 index 000000000..8bb3a24b5 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_version.go @@ -0,0 +1,245 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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 sqlserver 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 sqlserver 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/sqlserverflex/v3beta1api/response.go b/services/sqlserverflex/v3beta1api/response.go new file mode 100644 index 000000000..46b7f0b39 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/response.go @@ -0,0 +1,48 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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/sqlserverflex/v3beta1api/utils.go b/services/sqlserverflex/v3beta1api/utils.go new file mode 100644 index 000000000..348ac257b --- /dev/null +++ b/services/sqlserverflex/v3beta1api/utils.go @@ -0,0 +1,362 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +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/sqlserverflex/wait/deprecation.go b/services/sqlserverflex/wait/deprecation.go new file mode 100644 index 000000000..58f184c09 --- /dev/null +++ b/services/sqlserverflex/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